|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-10-02 21:09 UTC] jah at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
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.