[FX.php List] Date math driving me crazy

Bob Patin bob at patin.com
Sun Sep 30 13:48:15 MDT 2007


OK, I'm trying to figure out what's wrong with this:

<?php

$d1 = "10/28/2007";

$d2 = date("m/d/Y", strtotime ($d1) + 86400);
$d3 = date("m/d/Y", strtotime ($d1) + (2*86400));
$d4 = date("m/d/Y", strtotime ($d1) + (3*86400));
$d5 = date("m/d/Y", strtotime ($d1) + (4*86400));
$d6 = date("m/d/Y", strtotime ($d1) + (5*86400));
$d7 = date("m/d/Y", strtotime ($d1) + (6*86400));
$d8 = date("m/d/Y", strtotime ($d1) + (7*86400));
$d9 = date("m/d/Y", strtotime ($d1) + (8*86400));
$d10 = date("m/d/Y", strtotime ($d1) + (9*86400));
$d11 = date("m/d/Y", strtotime ($d1) + (10*86400));
$d12 = date("m/d/Y", strtotime ($d1) + (11*86400));
$d13 = date("m/d/Y", strtotime ($d1) + (12*86400));


echo $d8."---".$d9;
?>

This works fine with every month except when I'm working on November,  
for some strange reason, and I can't figure out why.

Look at $d8 and $d9; run that code and the dates will be the same;  
why???

Now, take $d1 and change it to 10/25/2007, or 10/26 or 10/27; it  
works fine; why is this happening?

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
Member of FileMaker Business Alliance and FileMaker TechNet

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060

--------------------------
Contact us for FileMaker hosting for all versions of FileMaker
PHP • CDML • Full email services • Free DNS hosting • Colocation •  
Consulting




More information about the FX.php_List mailing list