note 41045 added to function.mktime
| From: | joakimstai at rn2 dot php dot net | Date: | Sun, 28 Mar 2004 15:48:51 +0000 |
| Subject: | note 41045 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67284@lists.php.net to get a copy of this message | ||
As Nigel pointed out, you should be aware of DST (Daylight Savings Time) when using mktime(). Some
systems will return a negative value if you use 0 as the hour, as it will simply skip from (for
example) 23:59:59 to 01:00:00. Instead use 12 (noon) as the hour and you won't get a negative
timestamp or a date in the 1960's.
This code will work with DST:
$today = mktime(12, 0, 0, date("m"), date("d"), date("Y"));
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41045
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41045&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41045&report=yes
Search -- http://master.php.net/manage/user-notes.php