The fact that various dates land on the same weekday every year is the first principle we must understand to master the Doomsday algorithm. What we need next is a system to help us memorize a set of key dates throughout the year that all land on the same weekday every year.
These dates that we will learn are called Doomsdays.
In all the even months, apart from the special month of February, the doomsday is the same as the month number.
Remembering the phrase I work at 7-Eleven from 9 to 5 helps you recall four additional Doomsdays with ease. This mnemonic links the numbers 9 and 5 to months and their corresponding Doomsdays, simplifying recall.
The remaining three months are the first three of the year:
The doomsday in January depends whether the year is a leap. For all 3 regular years, the doomsday is the 3rd, and on the 4th year in the leap year cycle, the doomsday is 4th.
In February, we simply need to remember that the last day of the month is a doomsday. For generic years, this is the 28th. However, if it's a leap year, the last day is the 29th.
Since February is the month leading up to March, some people find it easier to remember the doomsday in February as the 0th day of March. This is the day before the first day. This also means you can use 7th, 14th, 21st and 28th (multiples of 7) as doomsday for March.
Here you can see that all the doomsdays are Thursdays in 2024:
The initial challenge in determining a weekday for a specific date lies in identifying the doomsday for that year. After establishing the year’s doomsday, you can then easily calculate the desired date’s weekday by counting forward or backward from the nearest doomsday.