note 22984 added to function.mktime

From: Date: Fri, 05 Jul 2002 23:34:31 +0000
Subject: note 22984 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-32653@lists.php.net to get a copy of this message
Speaking of Daylight Savings. I managed to embarass myself in public with the code: $myDt = mkTime(0,0,0,10,15,2002); $dayLength = 60*60*24; // the length of a day in seconds for ($i=0; $i<20; $i++) { echo ("Day: ".date("m/d/Y",$myDt)); $myDt += $dayLength; } mkTime(0,0,0,10,15,2002) returns midnight. 10/27/2002 has 25 hours; so adding 24 hours is not to get to the next date. The solution in this loop was to start with mkTime(2,0,0,10,15,2002). -- http://www.php.net/manual/en/function.mktime.php http://master.php.net/manage/user-notes.php?action=edit+22984 http://master.php.net/manage/user-notes.php?action=delete+22984 http://master.php.net/manage/user-notes.php?action=reject+22984

« previous php.notes (#32653) next »