I can't figure out why this is happening. Here's the code:
$i = 1;
$today = strtotime(date('Y-m-d',(mktime() + ($i * 604800))));
$weekday = date("w",$today);
$sunday = $today - ($weekday * 86400);
echo date('l', $sunday) . "<br>";
echo date('F jS', $sunday);
So far so good. Put in any value for $i and you get the relevant "Sunday" date: 0 = last Sunday (the 23rd), 1 = next Sunday (the 30th) and so on - for any Sunday in the year EXCEPT the first Sunday in April - for some reason this comes up as Saturday April 4, instead of Sunday April 5 (try putting in "6" for $i). Go through the year - everything works perfectly, then NEXT year, the first Sunday in April is screwed up again (try putting in "58" for $i).
This is a bit problematic as I've got a calendar I'm trying to do
(see http://www.carepartnership.org/development/getevents.php) and the first Sunday in April won't show up.
Is this a known issue? Any suggestions?