note 41052 deleted from function.mktime by bjori
| From: | bjori@php.net | Date: | Thu, 01 Jun 2006 18:40:09 +0000 |
| Subject: | note 41052 deleted from function.mktime by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-112812@lists.php.net to get a copy of this message | ||
Note Submitter: php_manual at it-rex dot nl
----
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.