PHP 4.0 Bug #4620: date("D",????) function returns one day early
| From: | dhartford at ghsinc dot com | Date: | Fri, 26 May 2000 18:15:29 +0000 |
| Subject: | PHP 4.0 Bug #4620: date("D",????) function returns one day early | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19534@lists.php.net to get a copy of this message | ||
From: dhartford@ghsinc.com
Operating system: Slackware Linux 7.0
PHP version: 4.0.0 Release
PHP Bug Type: Misbehaving function
Bug description: date("D",????) function returns one day early
I'm working on a Timesheet system with PHP 4.0 release. I setup the following statement:
echo date("D", strtotime($thisday)), ", ", $thisday;
where $thisday is calculated from a loop of the 7 days in a week. Here is the output:
Sat, 05/21/2000
Sun, 05/22/2000
Mon, 05/23/2000
Tue, 05/24/2000
Wed, 05/25/2000
Thu, 05/26/2000
Fri, 05/27/2000
It -looks- great, but unless I have a wierd calendar, 5/21/2000 is supposed to be a Sunday. Could
this be a leapyear bug with using date("D") or some cooky transition with strtotime
function? It is using the correct date because the date it used is printed right after the day.
I'm only just learning PHP, so mayhaps I did something wierd to screw it up, but since this is
the first release of PHP after Beta, I thought it may not be my horrible programming afterall.
BTW, thank you for sessions in PHP 4.0!!!
-D