DayOfWeek [ year_Integer, month_Integer, day_Integer ] :=
Block [ { y = year, m = month  - 2 },
If [ m < 3, { m, y } = { m + 12, y - 1 } ];
{ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }
[[1+
Mod[day+Floor[2.6 m - 0.2 ] + Mod [ y, 100 ] + Quotient[Mod[y,100],4]+Quotient[Quotient[y,100],4] - 2 Quotient [ y, 100], 7 ] ]]]

DayOfWeek[2009, 1, 23 ]