Something seems to be wrong with the strtotime function in PHP5.
I've created a staff resourcing database, which is used to assign staff to projects on a weekly basis.
The database stores assignments against a week ending date, which is derived using:
$week = date('Y-m-d',strtotime('Sunday'))
This works fine, $week is set to the current week ending date (Sunday) using this.
However, I also create $nextweek and $lastweek using:
$nextweek = date('Y-m-d',strtotime('next sunday',strtotime($week)));
$lastweek = date('Y-m-d',strtotime('last sunday',strtotime($week)));
This has also been working fine, until we got to week ending Sunday 30th October. For some reason, when $week = 2005-10-30, $nextweek becomes 2005-10-05, which is a Saturday.
I've tried replacing the 'next Sunday' with '+7 days', but this returns the same date.
Is this a bug? Am I missing something?
Any advice would be greatly appreciated.