I have two pieces of information extracted from a MySQL database, the year(2009, 2010, ect) and the week (1-52). And I need to convert it i
Try this out:
$year = 2000;
$week = 1;
$start = date("l, M jS, Y", strtotime("01 Jan ".$year." 00:00:00 GMT + ".$week." weeks"));
$end = date("l, M jS, Y", strtotime($start." + 1 week"));
echo $start." to ".$end;
You need to set $year and $week. It will then print the interval as specified.
For instance, the output as-is is:
Friday, Jan 7th, 2000 to Friday, Jan 14th, 2000
Note that weeks are indexed from 0-51 (easy to fix).
It's kind of ugly, but it works. Hope that helps!