note 50020 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 19:06:57 +0000 |
| Subject: | note 50020 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155200@lists.php.net to get a copy of this message | ||
Don't forget that months start on the 1st day, and not a zero date. Might seem obvious but:
<?php $test = date("F Y", mktime(0, 0, 0, 12, 0, 2005)); ?>
Will return November 2005, not December.
<?php $test = date("F Y", mktime(0, 0, 0, 12, 1, 2005)); ?>
The 1st is needed to get the right month.
--was--
Don't forget that months start on the 1st day, and not a zero date. Might seem obvious but:
$test = date("F Y", mktime(0, 0, 0, 12, 0, 2005));
Will return November 2005, not December.
$test = date("F Y", mktime(0, 0, 0, 12, 1, 2005));
The 1st is needed to get the right month.
http://php.net/manual/en/function.date.php