|
Posted by Rik Wasmus on 11/08/07 21:00
On Thu, 08 Nov 2007 20:06:08 +0100, Reg143 <Reg143@aol.com> wrote:
> Hi all,
>
> The code below loops from a starting date, incrementing the date and
> displaying date and day-of-week. Everything is fine until 2007-11-04 =
is
> reached. Any help would be appreciated.
I've tested the unaltered script (well, I disabled error reporting to =
check because there's no timezone set): works OK here. If it doesn't for=
=
you, var_dump() your variables and see what happens.
Then again, this does the trick:
<?php
date_default_timezone_set('EST');
$date =3D array();
$date[] =3D strtotime('2007-11-01');
for ($intX=3D0;$intX < 7;$intX++) {
echo date('Y-m-d',$date[$intX]).' '.date('l',$date[$intX])."<br>\n";
$date[$intX+1] =3D strtotime('+ 1 day', $date[$intX]);
}
?>
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|