Doomsday Method
(for working out weekdays from dates)

The Doomsday Method and Self-Test Program with date selection options.

On This Page ...
    Introduction
    Short Summary
    Longer Summary
    Mnemonics
    About Calendars
    The Doomsday Algorithm
    Example 1 (21st June 2019)
    Example 2 (2nd September 1666)
    Why it Works
    Century Anchor Days
    Doomsdays
    Sources
    Download a Self-test Program

Introduction
For a quick start, skip ahead to the heading The Doomsday Algorithm below.

Note that I use the term "weekday" to mean all days of the week, not just Monday to Friday.
Note that I also take years like 1900, 2000, 2100, ... as the first year of a new century - not the last year of the previous century.

The web pages I have listed at the bottom of this page cite various mathematicians, but the method I am describing here is the one suggested by John Conway. Other methods I have looked at either have something awkward about them, or there are certain years for which they do not work without adjustments. I have made my own tweak to account for the switch from the Julian calendar to the Gregorian calendar in the 1752.

It all looks rather daunting, but it's less complicated than it appears. Take it slowly at first, and with a little practice you will be able to do these calculations in your head, particularly for dates within a century or two of the present.

Go to top of page

Short Summary
Add together:
   a weekday number for the century (anchor day), and
   a weekday number for the year (slippage).
Use a mnemonic to find doomsday in the required month.
Count on, or back, to find the required weekday.

Go to top of page

Longer Summary
The method depends on finding the weekday for the last day of February, 28th or 29th, as that fixes the days to the dates for the entire year. For no real reason, that weekday is called "doomsday".

To work out doomsday, we need an "anchor day" for the century, which fixes the weekdays for the entire century. That is, in the years 1800, 1900, 2000, 3000 ...

Each year, the weekdays move on by either one or two days depending on the occurrence of leap years. This is because the length of a year is 52 weeks and one day, or two days in a leap year. We can call this process "slippage".

The weekdays are represented by numbers 0 to 6 where 0=Sunday, 1=Monday, ...

We add together the anchor day and the slippage to arrive at the weekday of doomsday for the year. This sum is likely to be more than a week, so we divide by 7 and take the remainder. Taking a remainder is written as "mod". For example, 17 mod 7 = 3.

All we need then is the date of doomsday in the month we are interested in, and from there work out the required weekday.

Go to top of page

Mnemonics
There are some fortuitous features of each month that make it easy to find the doomsday in each month.

After February, the doomsday of even-numbered months is the same as the month number, so the following dates have the same weekday as the last day of February:
  4th of the   4th month,
  6th of the   6th month,
  8th of the   8th month,
10th of the 10th month and
12th of the 12th month.

Odd-numbered months are almost as easy.
7th March (one week after February).
9th May and 5th September (Think 9 to 5 working hours - 9th of the 5th month, 5th of the 9th month)
11th July and 7th November (American supermarket chain? I just think seven and eleven sound similar - 11th of the 7th, 7th of the 11th)
That leaves January (Just have to remember it's 3rd in non-leap years and 4th in leap years)
Although, after much brain-searching, this idea came to me: "On 3, leap 4-ward". It's so silly, you'll probably remember that it applies to January.

Go to top of page

About Calendars
The calendar we use today is call the Gregorian calendar. It came into effect in the UK and its colonies on Thursday 14th September 1752. The day before that was Wednesday 2nd September 1752 on the Julian calendar. This means that eleven dates are missing (3rd to 13th September 1752). So, for example, if you are asked for the weekday of 4th September 1752, you have a choice: it either doesn't exist or it's Friday relative to the Julian calendar. You could also say it's Monday relative to the Gregorian calendar, but that seems less appropriate to me.

The Julian calendar has leap years every four years, regardless of the 400-year rule we have today.

Go to top of page

The Doomsday Algorithm
Let's use Guy Fawkes Day, 5th November 2019, to illustrate the method.

To work out the slippage, first take the last two digits of the four-digit year. (From 2019, use 19)

Divide by 12 (19 div 12 = 1)
Get the remainder (19 mod 12 = 7)
Divide the remainder by 4 (7 div 4 = 1)
Add these three numbers to get the slippage (1 + 7 + 1 = 9)
Get the remainder when divided by 7 (9 mod 7 = 2)

Next we add the anchor day for the century. Mostly, you only need to remember the anchor day for 2000 (2).
There is a simple method for this:
work out (century mod 4) and if you get 0 the anchor is 2, if 1 the anchor is 0, 2 gives 5, and 3 gives 3.
In the example, the century is 20 (from 2019). (century mod 4) = 0, so the anchor is 2.
My own method for finding this is simply to remember the sequence 0, 5, 3, 2, 0, 5, 3, ..., and apply it to the centuries like this:
1700* (0, but only from 14th September 1752 to 31st December 1799, before that, use 4)
1800 (5),
1900 (3),
2000 (2),
2100 (0),
2200 (5),
2300 (3)
...

For earlier centuries, it's a different sequence, 0, 6, 5, 4, 3, 2, 1, 0, 6, 5, ...
That is:
0000 (0), (There was no year 0000 but it serves our current purpose)
0100 (6),
0200 (5),
...,
1500 (6),
1600 (5).
1700* (4 up to and including 2nd September 1752, or, if you wish, 13th)
There is an easy formula for this: anchor = (21 - century) mod 7.

* There is more about 1700 under the heading "Century Anchor Days" towards the end of this page where the anchor days are listed.

For Guy Fawkes Day 2019 we need the anchor day for 2000 (2).
Add the slippage to the anchor to get the doomsday for 2019 (2 + 2 = 4).
The month is November. From the mnemonic, above, doomsday is 7th November (Thursday).
Therefore, Guy Fawkes Day, 5th November 2019, is two days earlier on a Tuesday.

Go to top of page

Example 1
What day of the week is Summer Solstice, 2019, 21st June 2019?

Last two digits of 2019 (19)

Divide by 12 (19 div 12 = 1)
Remainder (19 mod 12 = 7)
Remainder divided by 4 (7 div 4 = 1)
Anchor day for 2000 (from the sequence 5, 3, 2, 0 gives 2)

Add together to find doomsday (1+7+1+2 = 11)
Get mod 7 (11 mod 7 = 4 so doomsday is Thursday)
6th of the 6th month is, therefore, a Thursday.

Adding 7s we have the 20th is a Thursday,
so the 21st June 2019 is a Friday.

Go to top of page

Example 2
On what day of the week did the Great Fire of London start, 2nd September 1666?

Last two digits of 1666 (66)

Divide by 12 (66 div 12 = 5)
Remainder (66 mod 12 = 6)
Remainder divided by 4 (6 div 4 = 1)
Anchor day for 1600 (from the sequence 0, 6, 5, 4, 3, 2, 1, 0, ...)
Every 7th year has anchor day 0, so 1400 would be 0, so 1600 gives 5.

Add together for doomsday (5 + 6 + 1 + 5 = 17)
Get mod 7 (17 mod 7 = 3 so doomsday is Wednesday)
5th of the 9th month is, therefore, a Wednesday.
The 2nd was three days before Wednesday = Sunday.

The Great Fire of London started on Sunday 2nd September 1666.

Go to top of page

Why it Works
Some methods I have looked at have problems because years like 2000, 2400, ... are leap years while 1900, 2100 ... are not. John Conway's method avoids this by effectively counting days starting from those years, whether they are leap years or not. This means the method works for the both the Julian calendar and the Gregorian calendar. We just have to allow for eleven missing dates when the official calendar changed.

The century anchor is the last day of February (or 7th March) in the first year of the century (taken as 1800, 1900, 2000, ...). From this date we calculate how many weekdays the 7th March drifts in the years that follow. It advances one day each year and an extra day each leap year. For example:
  7 March 1999 is Sunday
  7 March 2000 is Tuesday (leap year)
  7 March 2001 is Wednesday
  7 March 2002 is Thursday
  7 March 2003 is Friday

In every twelve years starting from the beginning of the century, the weekdays advance by 12 + number of leap years. That is 15 days, so we treat every twelve years as if it moves the weekdays on by one day. For example:
  7 March 2000 is Tuesday
  7 March 2012 is Wednesday
  7 March 2024 is Thursday
  7 March 2036 is Friday
  7 March 2048 is Saturday

Each group of twelve years ends with a leap year. After accounting for whole twelves, therefore, the remaining years have one leap year for every four years, so after dividing by twelve, we add on the remainder + the remainder divided by 4.

The anchor day + the drift gives us the doomsday (= the weekday of the 7th March). Knowing the date of doomsday in each month makes it easy to find the weekday required.

You could, of course, not bother to divide by 12 to calculate the drift, by immediately dividing by 4, but this leads to larger numbers that are more difficult to handle in your head. Here's an example: what weekday is 5th April 2022?

To calculate the drift, take 22, add (22 div 4 = 5). Therefore the drift is 27 days. Add the anchor for 2000 (2) to get 29. We now need the remainder when 29 is divide by 7 (doomsday = 1 = Monday). So 4th April is a Monday, and the 5th April is a Tuesday.

Go to top of page

Century Anchor Days
(Note the sequences: 0, 6, 5, 4, 3, 2, 1, 0, 6, 5, ..., and 0, 5, 3, 2, 0, 5, 3, ...)

0000 0 Sunday (There was no year 0000, but use this for years 0001 to 0099)
0100 6 Saturday
0200 5 Friday
0300 4 Thursday
0400 3 Wednesday
0500 2 Tuesday
0600 1 Monday
0700 0 Sunday
0800 6 Saturday
0900 5 Friday
1000 4 Thursday
1100 3 Wednesday
1200 2 Tuesday
1300 1 Monday
1400 0 Sunday
1500 6 Saturday
1600 5 Friday
1700* 4 or 0 (Up to 13th September 1752 use 4 Thursday. From 14th use 0 Sunday.)
1800 5 Friday
1900 3 Wednesday
2000 2 Tuesday
2100 0 Sunday
2200 5 Friday
2300 3 Wednesday
2400 2 Tuesday
2500 0 Sunday
2600 5 Friday
2700 3 Wednesday
2800 2 Tuesday
2900 0 Sunday
3000 5 Friday

* The century beginning 1700 is awkward.
For dates from 1st January 1700 to 13th September 1752, this sequence (0, 6, 5, 4, 3, 2, 1, 0, 6, 5, ...) applies, giving an anchor day 4, Thursday, 29th February 1700.
For dates from 14th September 1752 to 31st December 1799, this sequence (0, 5, 3, 2, 0, 5, 3, ...) applies, giving an anchor day 0, Sunday. This is an exception to the anchor day being the last day of February. It is the weekday of 18th February 1700, eleven days before 29th, which takes account of the missing dates in 1752.

Go to top of page

Doomsdays
  3rd January (4th in leap years, not 3rd)
28th February (29th in leap years, not 28th)
  7th March
  4th April
  9th May
  6th June
11th July
  8th August
  5th September
10th October
  7th November
12th December

Go to top of page

Sources
https://en.wikipedia.org/wiki/Doomsday_rule
https://www.scientificamerican.com/article/calendar-algorithm/
https://www.timeanddate.com/date/doomsday-rule.html
https://www.timeanddate.com/calendar/
http://rudy.ca/doomsday.html
http://easydoomsday.blogspot.com

Go to top of page

Download a Self-test Program
This program requires Microsoft .NET Framework 4.6.1.
It is probably already on your computer, but if not get it from:
https://www.microsoft.com/en-gb/download/details.aspx?id=49981

Doomsday 4.1.1.zip (Updated 18 May 2019)
This program creates an ini file and a directory for logs in the same directory as the exe file.
For this reason you may prefer not to have it on the Desktop.

I do not expect to be paid for any programs on this site, but if you wish to
contribute, please contact the Suffolk Autism Social Club (SASC)
or the parent organisation at https://www.leadinglives.org.uk/
and make a donation.

Go to top of page