note 40571 added to function.mktime
| From: | ed_isthmus at NOSPAMyahoo dot com | Date: | Mon, 08 Mar 2004 11:23:56 +0000 |
| Subject: | note 40571 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66430@lists.php.net to get a copy of this message | ||
Further to a point iain made earlier, about problems with daylight savings time:
<?php
$timestamp = mktime(0, 0, 0, 3, 28, 2004);
echo date('d M Y H:i:s', $timestamp);
?>
Will output '27 Mar 2004 23:00:00' (in the UK)!
Best solution for me was to specify the dst argument:
<?php
$timestamp = mktime(0, 0, 0, 3, 28, 2004, 0);
?>
Alternatively, you could use gmmktime(); and/or check the timezone offset.
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40571
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40571&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40571&report=yes
Search -- http://master.php.net/manage/user-notes.php