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

Bob Patin bob at patin.com
Mon Oct 1 09:57:40 MDT 2007


It was daylight savings time; when I run it here, 10/4/2007 would  
always get printed twice. When I take $thetime and add 43200 to it,  
to make it equal NOON on the given day, it works fine...

I wonder why it's not producing the same error on your computer;  
could it be your daylight savings time settings? Mac or PC? I'm on a  
Mac... at any rate, thanks to Troy's help, the problem is solved...

Bob


On Sep 30, 2007, at 3:06 PM, Leo R. Lundgren wrote:

> 30 sep 2007 kl. 22.02 skrev Bob Patin:
>
>> 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
>
> I tried this, and your first post as well, and I don't see the  
> problem. Here's the output I get from the last one;
>
> 10/28/2007
> 10/29/2007
> 10/30/2007
> 10/31/2007
> 11/01/2007
> 11/02/2007
> 11/03/2007
> 11/04/2007
> 11/05/2007
> 11/06/2007
> 11/07/2007
> 11/08/2007
> 11/09/2007
> 11/10/2007
> 11/11/2007
> 11/12/2007
> 11/13/2007
> 11/14/2007
> 11/15/2007
> 11/16/2007
> 11/17/2007
> 11/18/2007
> 11/19/2007
> 11/20/2007
> 11/21/2007
> 11/22/2007
> 11/23/2007
> 11/24/2007
> 11/25/2007
> 11/26/2007
> 11/27/2007
> 11/28/2007
> 11/29/2007
> 11/30/2007
> 12/01/2007
> 12/02/2007
> 12/03/2007
> 12/04/2007
> 12/05/2007
> 12/06/2007
> 12/07/2007
>
> Regards, Leo
> _______________________________________________
> 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