note 32421 added to function.date
| From: | designer at rack1 dot php dot net | Date: | Tue, 27 May 2003 12:44:13 +0000 |
| Subject: | note 32421 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49092@lists.php.net to get a copy of this message | ||
Someone asked me how to adjust a time for daylight savings if the server stayed on GMT. Here's
the best way I could think of. Just use the variable $Now whenever you need a date-time:
//check if its GMT or DST...//
if (date("I") == 1)
{$Now = date("Y-m-d H:i:s",time()-3600);}
else
{$Now = date("Y-m-d H:i:s");}
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32421
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32421&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32421&report=yes