note 22984 deleted from function.mktime by dams
| From: | dams@php.net | Date: | Sat, 06 Jul 2002 00:27:44 +0000 |
| Subject: | note 22984 deleted from function.mktime by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-32660@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).