Doomsday Algorithm – Calculating the Weekday for any given Date
Step 1:
- Memorizing Weekdays as Numbers
- { Sunday = 0; Monday = 1; Tuesday = 2; Wednesday = 3; Thursday = 4; Friday = 5; Saturday = 6 }
Step 2:
- Memorizing Anchor Days — { 1800 – 1899: Friday; 1900 – 1999: Wednesday; 2000 – 2099: Tuesday; 2100 – 2199: Sunday }
- Subtract 400 for years outside this set of ranges, e.g., for 1700 – 1799, anchor day is same as for 2100 – 2199
Step 3:
- Calculate Doomsday for any Year
[A] How many times does the number 12 fit as a whole into the two last digits of the year number? Example: February 11, 1978. The number 12 fits 6 whole times into 78 (6 x 12 = 72), so the result is 6.
[B] What is the difference between the two last digits of the year number and the product of the multiples of 12 from calculation in [A]? Example: The product of 6 x 12 is 72 (see calculation in [A]). The difference between 72 and 78 is 6, so the result is 6.
[C] How many times does the number 4 fit into the result of calculation in [B]? Example: The result of calculation [B] was 6. The number 4 fits only once into the number 6, so the result is 1.
[D] What is the century’s anchor day? Example: The anchor day of the 1900s is Wednesday, which corresponds to number 3 (see step 1), and the result is 3.
[E} Add up all the results. Example: 6 + 6 + 1 + 3 = 16, and the result is 16
[F} Subtract whole multiples of 7 from the result of calculation in [E} above. This will result in a number between 0 and 6, which corresponds to the doomsday of the year. Example: 16 – 14 = 2, so the result is 2. This means that doomsday in 1978 was a Tuesday.
Step 4:
- Move from – Doomsday to the Date in Question
While dates like 4/4, 6/6, 8/8, 10/10 and 12/12 are relatively easy to remember, there is a handy mnemonic to memorize the fixed doomsday dates in the odd-numbered months, most of which are based on either 5 and 9, or 7 and 11 (except March): I work from 9 to 5 at 7-11.