note 40749 added to function.date
| From: | johnlist at gulfbridge dot net | Date: | Fri, 12 Mar 2004 22:32:28 +0000 |
| Subject: | note 40749 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66758@lists.php.net to get a copy of this message | ||
Beware of Octal Months!
When performing calculations on the current month, be sure to use date('n'), not
date('m'). Both return a numeric representation of the month, but date('m')
always returns two digits, zero filled when necessary. And that leading zero renders it an octal
number, not decimal!
(You would think this wouldn't matter for months 1 - 7 at least, but I have found that
supplying any octal number as the index of an array returns an "undefined index" error.
[PHP 4.1.2] )
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40749
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40749&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40749&report=yes
Search -- http://master.php.net/manage/user-notes.php