Time & Calendar
Intermediate
Day of the Week from a Birthdate
Gauss's weekday formula — find which day of the week any birthdate fell on.
Formula
Variables
dDay of month
mMonth (Mar=1 … Dec=10, Jan=11, Feb=12 of prior year)
yYear within century
cCentury
W0=Sun,1=Mon,…,6=Sat
Example
15 Aug 1947 → W = 5 ⇒ Friday
Did You Know?
Isaac Asimov reportedly could name the weekday of any date in his head; the trick is exactly this kind of modular arithmetic.