The Doomsday algorithm is a memory trick that lets you figure out the day of the week that a given date falls on. I’ll go over the simplest variation of this which is a good starting point, and requires refreshing just once a year.

### The last day in February

For this year of writing (2023) the last day in February is the 28^{th} and it falls on a Tuesday. This is the *anchor* day, and is the only variation you need to memorize for a given year.

The rest of the mnemonic stays the same every year. There will be a day in each month which also falls on that anchor day (Tuesday). Once you know where you are in a month, you can work forwards or backwards to figure out the day.

### The Even Months

For the remaining even months in the year, just match the month number with itself.

- The 4
^{th}of the 4^{th}month (April 4) - The 6
^{th}of the 6^{th}month (June 6) - The 8
^{th}of the 8^{th}month (August 8) - The 10
^{th}of the 10^{th}month (October 10) - The 12
^{th}of the 12^{th}month (December 12)

All fall on the anchor day (Tuesday).

### The Odd Months

For the odd months, remember this: “9 to 5 at 7-11”.

- The 9
^{th}of the 5^{th}month (May 9) - The 5
^{th}of the 9^{th}month (September 5) - The 7
^{th}of the 11^{th}month (November 7) - The 11
^{th}of the 7^{th}month (July 11)

All fall on the anchor day (Tuesday).

### January

For January, remember this: “3 out of 4”.

The anchor day is on the 3^{rd} every 3 out of 4 years. It’s on the 4^{th} on leap years.

That means for 2021, January 3^{rd} falls on the anchor day (Tuesday).

### March

If you look at a calendar, you’ll notice that all the dates in February and March fall on the same day.

That means just like February, March 28^{th} falls on the anchor day (Tuesday). Even easier, any multiple of 7 in March will also match the anchor day.

## Practice

You can now practice - pick a random date in the year. Figure out that month’s anchor day, then work towards the date.

Example: December 25^{th} 2021.

- The 12
^{th}of the 12^{th}month. - December 12
^{th}is a Tuesday. - 12 + 14 days = 26
^{th}is a Tuesday - 25
^{th}is a Saturday

Example: September 15^{th} 2021.

- 5
^{th}of the 9^{th}month - September 5
^{th}is a Tuesday - 5 + 7 = 12
^{th}is a Tuesday. - Plus a few more days, September 15
^{th}is a Wednesday

## Advanced Doomsday - figure out the anchor day for a given year

It’s actually possible to figure out which day will be the anchor day, just by looking at the year itself. This is because the calendars repeat themselves every 400 years, and roughly you need to figure out the anchor day for the century, then the anchor day for the year, and then the anchor day for each month.

The algorithm for that is described here and is also on Wikipedia.

It’s too much effort for me so I just memorize the anchor day for the year at the beginning of each year.