note 42158 added to function.date
| From: | ChrisFinke | Date: | Wed, 05 May 2004 16:45:19 +0000 |
| Subject: | note 42158 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69255@lists.php.net to get a copy of this message | ||
When using date("r"), be aware that on single-digit days of the month, an extra space is
inserted to hold the place of the leading zero. I spent a while scratching my head over this one.
On January 6, date("r") will return
Tue, 6 Jan 2004 22:26:00 -0600
(note the two spaces between "Tue," and "6") but on January 10,
date("r") will return
Sat, 10 Jan 2004 22:26:00 -0600
So if you do something like
explode(" ",date("r"));
on January 6, you'll get
Array (
[0] => Tues,
[1] =>
[2] => 6
[3] => Jan
[4] => 2004
[5] => 22:26:00
[6] => -0600 )
Although it might seem like a bug, it's not. See this bug report <http://bugs.php.net/bug.php?id=26822> for the
official information.
Chris Finke
Toby Web Mail: http://toby.sourceforge.net/
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42158
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42158&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42158&report=yes
Search -- http://master.php.net/manage/user-notes.php