Code: Select all
$date = new DateTime();
$formatter = new IntlDateFormatter('vi', IntlDateFormatter::LONG, NULL, 'America/Los_Angeles', NULL, "EEEE");
$dayofweek = $formatter->format($date);
I can think of an inelegant solution to this. December, 2013 started on a Sunday, so I can use it as my "proxy" date, like so: new DateTime(2013-12-$dow), where $dow is the day of the week, from 1 to 7. If the value of $dow is 3, Wednesday would be returned, but if there is a way for the IntlDateFormatter (or DateTime) to work with non-specific dates, it would be a better solution.