Time & Calendar
Advanced

Zeller's Congruence

Finds the day of the week for any Gregorian date.

Formula

h=(q+13(m+1)5+K+K4+J4+5J)mod7h = \left(q + \left\lfloor\tfrac{13(m+1)}{5}\right\rfloor + K + \left\lfloor\tfrac{K}{4}\right\rfloor + \left\lfloor\tfrac{J}{4}\right\rfloor + 5J\right) \bmod 7

Variables

qDay of month
mMonth (Mar=3 … Feb=14)
KYear of century
JZero-based century
h0=Sat,1=Sun,…

Example

For 2000-01-01 the formula returns h = 7 ⇒ Saturday

Did You Know?

Christian Zeller published this in 1882; January and February count as months 13 and 14 of the previous year.