🏠
Guest Not signed in

Doomsday β€” Day of the Week

Conway's algorithm β€” type the weekday as 0..6

90.0s

Technique: Conway's Doomsday algorithm

You're shown a calendar date β€” type the day of the week as a single integer.

Answer key:

NumberDay
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday

(Same convention as JS Date.prototype.getDay(). The compact bar above the input field repeats this map.)

Step 1 β€” Century anchor

Each century has a "Doomsday" β€” a known weekday for a fixed reference date.

CenturyAnchor dayNumber
1700sSunday0
1800sFriday5
1900sWednesday3
2000sTuesday2
2100sSunday0

Mnemonic: anchors cycle Sun β†’ Fri β†’ Wed β†’ Tue β†’ Sun (a "step back" of 5 then 2 then 1 then 5...).

Step 2 β€” Year offset within the century

For year YY (last two digits): the year's Doomsday is

(YY + ⌊YY / 4βŒ‹) mod 7 days after the century anchor.

Example: 1992 β†’ YY=92, ⌊92/4βŒ‹=23, sum=115, 115 mod 7 = 3. 1900s anchor is Wed (3), so 1992's Doomsday is Wed + 3 = Saturday.

Step 3 β€” Memorable Doomsday dates per month

The following dates ALL fall on the year's Doomsday:

  • Even months: 4/4, 6/6, 8/8, 10/10, 12/12
  • "9-to-5 at the 7-11": 5/9, 9/5, 7/11, 11/7
  • March: Mar 7 (or "Mar 0" = last day of Feb)
  • January: Jan 3 in common years, Jan 4 in leap years
  • February: Feb 28 in common years, Feb 29 in leap years

Step 4 β€” Shift from month-Doomsday to target date

Take the closest Doomsday in the target month. Compute (target_day βˆ’ doomsday_day) mod 7 β€” that's how many weekdays to advance from the year's Doomsday.

Worked example β€” Dec 7, 1941 (Pearl Harbor)

  1. Century anchor: 1900s β†’ Wednesday (3).
  2. Year offset for 1941: YY=41, ⌊41/4βŒ‹=10, sum=51, 51 mod 7 = 2. 1941 Doomsday = Wed + 2 = Friday (5).
  3. December's Doomsday is 12/12 = Friday.
  4. Dec 7 is 5 days before Dec 12. Friday βˆ’ 5 = Sunday. (Or: 7 βˆ’ 12 = βˆ’5, (βˆ’5) mod 7 = 2, Friday + 2 = Sunday.)
  5. Answer: 0 (Sunday). βœ“

Every question has a 30 second shot clock. Type the integer 0..6 and press Enter.

Independent · Legal