public function getDayofWeek($year, $month, $day) { $dt = new DateTime(); $dt->setDate($year, $month, $day); return (int) $dt->format('w'); }