Works out of the box
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
//start and end dates of a week function getStartAndEndDate($week, $year) { $dto = new DateTime(); $dto->setISODate($year, $week); $ret['week_start'] = $dto->format('Y-m-d'); $dto->modify('+6 days'); $ret['week_end'] = $dto->format('Y-m-d'); return $ret; } $week_array = getStartAndEndDate(46,2018); print_r($week_array); |