note 71920 deleted from function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 02:51:44 +0000 |
| Subject: | note 71920 deleted from function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141996@lists.php.net to get a copy of this message | ||
Note Submitter: wcc at techmonkeys dot org
----
In example 3, <?php date("m") ?> is passed to mktime() for the month argument. I
believe <?php date("n") ?> should be used instead so that the leading 0's
don't make PHP think the arguments are octal values. The same goes for <?php
date("j") ?> instead off <?php date("d") ?>.
<?php
echo mktime(0, 0, 0, 09, 09, 2006);
echo "\n";
echo mktime(0, 0, 0, 9, 9, 2006);
?>
1133326800
1157774400