[FX.php List] Even stranger date math...

Troy Meyers tcmeyers at troymeyers.com
Sun Sep 30 14:34:57 MDT 2007


Bob,

The strtotime() assumes a US English date and time, so I guess they built in the DST adjustment. Note that in my prior post I included an offset time of 0... I think if you don't supply that it defaults to the current time, which could cause further troubles.

No, DST ends on November 4th this year.

-Troy


> I think you're right; I just looked, and DST ends on the 28th.
> 
> So I'm off by an hour then...
> 
> Sheesh... that'll cause problems twice each year. I'll have to write  
> code that looks for the change days and add or subtract an hour...
> 
> Thanks, I would never have found it; it was driving me completely  
> batty. I'm surprised though that PHP is DST-savvy to this extent.
> 
> BP
> 
> On Sep 30, 2007, at 3:22 PM, Troy Meyers wrote:
> 
> > Because of when daylight savings time ends? > > -Troy > > >> OK, so I
> decided to use a WHILE loop, and the results are just as >> strange: >>
> >> <?php >> >> $d1 = "10/28/2007"; >> >> $thetime = strtotime($d1); >>
> >> $x = 2; >> >> while ($x < 43){ >> >> 	$thetime = $thetime + 86400; >>
> >> 	$d[$x] = date('m/d/Y',$thetime); >> >> 	echo $d[$x]."<br>"; >> >>
> 	$x++; >> >> } >> >> ?> >> >> Check it out... why does this not work
> right? >> >> _______________________________________________ >> >>
> FX.php_List mailing list >> >> FX.php_List at mail.iviking.org >> >>
> http://www.iviking.org/mailman/listinfo/fx.php_list > >
> _______________________________________________ > FX.php_List mailing
> list > FX.php_List at mail.iviking.org >
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> _______________________________________________
> 
> FX.php_List mailing list
> 
> FX.php_List at mail.iviking.org
> 
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list