note 41052 added to function.mktime
| From: | php_manual at it-rex dot nl | Date: | Sun, 28 Mar 2004 22:48:07 +0000 |
| Subject: | note 41052 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67293@lists.php.net to get a copy of this message | ||
I found that using the mktime override function of rickenmeer at hotmail dot com like so:
mktime(0, 0, 0, 1, 1, 1970);
returned -3600 instead of 0, because the standard mktime function gets used for 1970 and above.
changing the line
if ($year >= 1970) return mktime ($hour, $minute, $second, $month, $date, $year);
to
if ($year > 1970) return mktime ($hour, $minute, $second, $month, $date, $year);
solves this (if you're only working with dates, ie. not using time), because the mktime
function will not be used around the 'sensitive' area of 1970.
I guess it has something to do with daylight savings time or timezone correction (I'm in GMT +1
myself), but I haven't tested exhaustively.
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41052
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41052&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41052&report=yes
Search -- http://master.php.net/manage/user-notes.php