PHPology is a collective of highly skilled, award winning, web gurus.
Contact Raj on 07985 467 213 or email [email protected]

PHP - get date via week number and year

Working on an internal timesheet system at @TSLDigital where I display a list of users with their timesheet approval status. Currently I was just displaying the week number and year but to some extent was not really informative enough for the resource manager.

I decided to add the month using the weeknum and year using the below solution.

$date = new DateTime();
$date->setISODate(43, 2013);
echo $date->format('F')."<br/>";
//or you can add other formats too
echo $date->format('d-F-Y')."<br/>";