note 40749 deleted from function.date by nlopess
| From: | nlopess@php.net | Date: | Sat, 13 Mar 2004 21:30:21 +0000 |
| Subject: | note 40749 deleted from function.date by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66779@lists.php.net to get a copy of this message | ||
Note Submitter: johnlist@gulfbridge.net
----
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] )