I'm trying to get the date from the week number, day number and year.
For eg:
week number = 52
day number = 4 (of week 52)
year = 2013
In this case, the date should be 26-12-2013
.
How can I do it using PHP? I've already tried with strtotime()
, but I'm confused about the formats. Can someone help?
Make use of setISODate()
<?php
$gendate = new DateTime();
$gendate->setISODate(2013,52,4); //year , week num , day
echo $gendate->format('d-m-Y'); //"prints" 26-12-2013