Bug #2424: date() function missing a day after Oct. 31, 1999
| From: | Ron at RLT dot COM | Date: | Sat, 02 Oct 1999 22:11:40 +0000 |
| Subject: | Bug #2424: date() function missing a day after Oct. 31, 1999 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11443@lists.php.net to get a copy of this message | ||
From: Ron@RLT.COM
Operating system: Linux 2.2.6 (slackware)
PHP version: 3.0.12
PHP Bug Type: Misbehaving function
Bug description: date() function missing a day after Oct. 31, 1999
This code snippet generates a correct date for Saturdays in Oct., but then
starts listing dates for Friday starting in Nov. on through March of next year, then in Apr. 2000
starts reporting Saturday dates again. Changing the date() function to gmdate() corretly lists only
dates for Saturdays through next year.:
$secinday = 60 * 60 * 24; // seconds in a day
$secinweek = $secinday * 7; // seconds in a week
$thisday = date("w");
$daystillsat = 6 - $thisday;
$shipdate = ($daystillsat * $secinday) + mktime(0,0,0,10,02,1999);
for($i=0; $i < 52; $i++) {
print (date(" M d, Y \n",$shipdate) );
$shipdate += $secinweek;
} // end for
PHP 3.0.12 compiled as a statically linked module to Apache 1.3.6
No other modules compiled in. PHP is standard "out-of-the-box" with no modifications to
the default setup other than the install path.