PHP: mktime()

Soldato
Joined
15 Dec 2004
Posts
3,819
Hi,

I am using mktime() to generate a list of dates between a start date and an end date with one week spaces for example, Monday 1st January, Monday 7th January, Monday 14th January:

Code:
while ($startdate <= $enddate) {

echo strftime("%A %d %B %y",$startdate);
$startdate = $startdate + 604800;

}

With 604800 being equal to 7 days in mktime format. This is working very nicely however if I set the start date to a time later than april then it starts subtracting days from the end of october onwards so Saturday 02 February 2008 is displayed as Friday 02 February 2008 :( It corrects itself around March time the following year and is also fine if the start date is less than april and as I'm kinda new to PHP, I haven't a clue what's wrong :(

Any help would be appreciated,

Thanks :)

Ben
 
Back
Top Bottom