note 39914 added to function.mktime
| From: | NigelGilbert at rn2 dot php dot net | Date: | Sun, 15 Feb 2004 17:15:54 +0000 |
| Subject: | note 39914 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65173@lists.php.net to get a copy of this message | ||
Several posts here offer procedures to compute the number of days between two dates based on using
mktime, using the given date and 00:00:00 as the time. It turns out that this is bad choice for the
default time for such calculations when the date in question happens to be the date when daylight
savings time starts. For example, on several OSs, there is no such time as 00:00:00 30-03-2003 (and
mktime returns a negative value), because the clock changed from 23:59:59 29-03-2003 straight to
01:00:00 30-03-2003 as a result of Daylight Saving. At better choice is to use, for example,
12,0,0,30,3,2003 as the argument to mktime, that is, use noon, not midnight as the default time.
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39914
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39914&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39914&report=yes
Search -- http://master.php.net/manage/user-notes.php