Jump to content

Doomsday rule: Difference between revisions

m
No edit summary
Line 84:
# Conway's doomsday algorithm
c, r = divrem(year, 100)
canchor = (5 * (c % 4) + 2) % 7 # anchor for centirycentury
doomsday = ((r ÷ 12) + (r % 12) + ((r % 12) ÷ 4) + canchor) % 7
anchorday = (year % 4 != 0) || (r == 0 && year % 400 == 0) ? # leap year determination
4,108

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.