You are here: Re: Strange date increment problem « PHP Programming Language « IT news, forums, messages
Re: Strange date increment problem

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация