Doomsday Algorithm
What day of the week was any date in history? Learn the mental math trick behind it.
The core idea
Mathematician John Conway discovered that certain easy-to-remember dates always fall on the same day of the week in any given year — the Doomsday. Once you know it, you can work out any date.
Step 1 — Century anchor
Each century has a fixed anchor day. 2000s → Tuesday, 1900s → Wednesday, 1800s → Friday, 1700s → Sunday.
Step 2 — Doomsday for the year
Take the last two digits of the year as y, then:
a = ⌊y/12⌋ · b = y mod 12 · c = ⌊b/4⌋
Doomsday = (anchor + a + b + c) mod 7
Step 3 — Nearest Doomsday date in the month
Find a date in the same month that always lands on Doomsday: 4/4, 6/6, 8/8, 10/10, 12/12 — and for odd months: 5/9, 9/5, 7/11, 11/7. Jan: 3rd (4th leap), Feb: last day.
Step 4 — Count the offset
Count how many days your target is from that anchor date, add or subtract from the Doomsday, mod 7. Done!
Century anchors
| Century | Anchor |
|---|---|
| 1800s | Friday |
| 1900s | Wednesday |
| 2000s | Tuesday |
| 2100s | Sunday |
Day numbers
| # | Day |
|---|---|
| 0 | Sunday |
| 1 | Monday |
| 2 | Tuesday |
| 3 | Wednesday |
| 4 | Thursday |
| 5 | Friday |
| 6 | Saturday |
Doomsday dates by month
Memory tricks
Odd months: "I work 9-5 at 7-11" → May 9, Sep 5, Jul 11, Nov 7
Even months: 4/4, 6/6, 8/8, 10/10, 12/12 — easy doubles!
What day is this date?