Keep practicing how quickly and consistently can you find the correct weekday for a date.
Confidently determine the weekday of any given date, anywhere and anytime without relying on a calendar.
Enhance your mental agility by mastering the art of date-to-weekday conversion.
Be the one who casually answers when someone asks what day Christmas lands on this year.
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 January the 4th.
In February, we simply need to remember that the last day of the month is the doomsday. This means that the doomsday is leap year dependent.
Finally for March, it can be very useful to think of the last day of 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.
And this leads us to the next concept.
In order to do simple arithmetic operations on dates, we must think of the days of the week not as names but as numbers.
Luckily, this is very easy to learn and to remember.
In the doomsday algorithm, each weekday has a number, starting with Sunday as 0 and Monday as 1, up to Saturday as 6. There are some useful mnemonics that we can use to help us memorising these weekday numbers:
The foundational arithmetic skill in the Doomsday algorithm involves adding and subtracting numbers from a weekday. This skill is essential for swiftly calculating the correct weekday, and it requires a comfortable familiarity with the concept that days of the week are represented as numbers.
Speed in this algorithm depends on your comfort with mental calculations like Tuesday (2) plus two equals Thursday (4). A trickier example is Saturday (6) plus 6 equals Friday (5). It may seem counterintuitive since 6 + 6 equals 12, not 5. This is where understanding the modulo operation becomes crucial.
The modulo can be understood as a way to find the remainder of a division. In the context of the doomsday rule, when you add days to a date, you divide the total number of days by 7 (since there are 7 days in a week) and the remainder gives you the correct weekday.
For example, in the case of Saturday (6) plus 6, you calculate 6 + 6 = 12. Now, divide 12 by 7. The quotient is 1 (which represents one complete week) and the remainder is 5. Thus, 12 modulo 7 is 5, which corresponds to Friday. So, Saturday plus 6 days indeed lands on a Friday.
This modulo operation ensures that no matter how many days you add, you’ll always land on a valid day of the week. It’s like a clock that wraps around after reaching the highest number — in this case, Saturday (6).
Here’s another example: If it’s Wednesday (3) and you want to find the day 10 days later, you calculate 3 + 10 = 13. Performing the modulo operation, 13 modulo 7 is 6, which is Saturday.
Therefore, the key to mastering the doomsday algorithm lies in getting comfortable with quickly performing these modulo operations. The more you practice, the easier it becomes to instantly know the day of the week for any given date.
The first number you need to determine the doomsday for a year is to find its anchor day. Anchor days are specific to the century the date is inside.
Each century is linked with a specific anchor day, and since our calendar loops around every 400 years, there are actually only four anchor days that you need to memorise.
You must simply just memorise these weekday numbers. Luckily, in most everyday situations, dates you might want to convert to weekdays will typically be in one or two of these centuries. Knowing that years in 19xx has Wednesday as its anchor and years in 20xx has Tuesday should be enough for almost all practical use cases.
In order to apply the doomsday algorithm accurately, you also need to quickly determine whether a year is a leap year or not. And to do so, you will need to memorise the following rules:
By following this diagram you can determine whether any year is a leap year or not.
Here are some example years:
We can now use this knowledge to calculate which weekday the doomsday is for any year.
To do this efficiently, you must hold a few values in your short-term memory. Don’t worry if you find this a bit tricky to start with, this will be much easier with practise.
Example year: 1966.
Determine the anchor day for the date and store the number 3 in your memory bank. Then discard the century, you won’t need it any more. The remaining calculations concerns only the last two digits of the year.
Find the highest multiple of 12 for the last two digits of the year. You can do this by dividing the number by 12 and round the answer down to the nearest whole number. Another way to think about this is to count how many times you can add 12 before reaching this number. In our example the answer is 5, because 5 × 12 = 60 and 6 × 12 is 72, which is higher than 66, so we can only fit five 12s into 66. Let’s add 5 to our working memory.
This step involves finding the remainder when the last two digits of the year are divided by 12. The modulo operation, as previously discussed, helps in dealing with cycles, such as the 7-day week cycle in the Doomsday rule. For the year 1966, we take the last two digits, which are 66, and perform a modulo 12 operation. When you divide 66 by 12, the remainder is 6. Therefore, the modulo 12 of 66 is 6. This number is important as it tells us how many years we are ‘over’ after fitting in as many complete cycles of 12 years as possible. Add 6 to your mental tally.
The final number to keep in mind is the count of fours within our modulo 12 result. Since we have determined that our modulo 12 number is 6, we now need to calculate how many full sets of four can be found in this number. This step is essential because every leap year cycle, which occurs every four years, influences the weekday pattern. For the number 6, there is only one full set of four, as 4 can be subtracted from 6 once, leaving a remainder of 2. So, we will remember the number 1 for this step. This count of fours represents the leap year adjustments needed for our calculation.
Now, it’s time to combine the numbers we’ve collected and use the modulo 7 operation to determine the Doomsday of the year 1966. This step is crucial because it ties together all the individual calculations we’ve done so far.
Start by summing the numbers from our previous steps: the anchor day (3), the highest multiple of 12 (5), the modulo 12 result (6), and the count of fours (1). In our case, this adds up to 3 + 5 + 6 + 1 = 15. Now, to find the Doomsday of the year, we apply the modulo 7 operation to this sum. This is done because there are 7 days in a week, and this operation helps us to cycle back to the correct weekday.
Performing the modulo 7 operation on 15, we get 1; therefore, the Doomsday for 1966 is Monday.
Once you have determined the Doomsday for a specific year, you can use it to find the weekday of any given date in that year. This is the practical application of the Doomsday algorithm, allowing you to calculate the day of the week for any date quickly.
For instance, let’s use the year 1966, for which we’ve calculated the Doomsday as Monday. To find out what weekday a specific date fell on, like 20 July 1966, you first identify the closest Doomsday date. In July, the Doomsday date is the 11th (which we know is a Monday). 20 July is 9 days after 11 July.
To find the weekday of 20 July, add 9 days to the Doomsday. Since 7 days make a week, and we’re dealing with days of the week, you can reduce 9 by multiples of 7. In this case, 9 minus 7 leaves 2. So, 20 July is 2 days after the Doomsday (Monday). Thus, adding 2 days to Monday brings us to Wednesday. Therefore, 20 July 1966 was a Wednesday.
This method can be applied to any date in the year. It’s a matter of finding the nearest Doomsday, calculating the difference in days, and then adjusting for the 7-day week cycle. With practice, this becomes an intuitive and rapid process, making it easy to determine the weekday for historical events, future planning, or just satisfying your curiosity.