[FX.php List] Date math driving me crazy

Nick whatdoyouwant at gmail.com
Wed Oct 3 10:57:09 MDT 2007


because on November 4th the time changes.
try printing out the time in your tests with date('m/d/Y h:i:s A', ...

On 9/30/07, Bob Patin <bob at patin.com> wrote:
>
> 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
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20071003/5e6691a0/attachment.html


More information about the FX.php_List mailing list