How to Calculate the Day of the Week for a Given Date

Fancy Calendar

There are a few variations on how to work out the day of the week for a given date but this version, known has the Doomsday Rule by John Conway, has both simple mathematics and doesn’t require a great deal of prior memorisation.

  • First if the century part of the date begins with 19, as in the year 1999 then your core day is Wednesday.
  • If the date begins with a 20, as in 2002, then the core day is Tuesday. You can remember this as Y Tuesday if you are of an age to remember the Y2K issues as known as the millennium bug.

Now the next thing you need to remember is the formula for the second part of the year. If 1982, then we’re looking at the 82 part. For this we use what’s known as the Odd 11 method.

  1. If the input year x is an odd number, add 11 to it. Otherwise, do not add anything
  2. Divide the result by 2
  3. If the result is an odd number, add 11 to it. Otherwise, do not add anything
  4. Calculate the modulo 7 of the result to get a remainder
  5. Subtract this remainder from 7 to get the doomsyear of x.

For our example with 1982

  • 82 is even
  • 82 / 2 = 41
  • 41 is odd, add 11 = 52
  • 52 mod 7 = 3 (7 * 7 = 49. 52 – 49 = 3)
  • 7 – 3 = 4.

Previously I said that the century part, “19″ is a Wednesday. So, taking this “4″ we now have 1982 as Wednesday plus four days = Sunday.

Now we need to know what days are “Doomsdays” within the year. To start with there are several easy to remember static Doomsdays for every year, these are:

  • April 4th (4/4)
  • June 6th (6/6)
  • August 8th (8/8)
  • October 10th (10/10)
  • December 12th (12/12)

We can also remember the phrases “9 to 5″ and “7-11″ for other months

  • May 9th
  • July 11th
  • September 5th
  • November 7th

It’s always the last day of February and the 21st of March (first day of Spring). Also for 3 out of 4 years (non leap) it’s January 3rd, leap years it’s January 4th.

Putting that altogether we have:

January 3rd (4th in leap years)
February Last day (28th or 29th in a leap year)
March 21st
April 4th
May 9th
June 6th
July 11th
August 8th
September 5th
October 10th
November 7th
December 12th

Lets say we want the date the 16th of December of 1982.
The Doomsday for December is the 12th. We take the 16 of the date less 12 and get 4.

Now we calculate all the parts. If the year was 1982 then the base is Sunday as shown above.
Sunday + 4 days = Thursday.
So, 16th December 1982 was on a Thursday.

Lets try another example the other way round as some people find it easier to work from the day/month part first. Lets work on the 31st of May 2002.

May’s Doomsday is the 9th (nine to five), so we know (by adding 7 at a time) that the 16th, 23rd and 30th are also the Doomsday. The 31st is therefore 1 away from the Doomsday.

The Century part is “20″ which is a Tuesday. The year part of “02″ is calculated thus:

  1. 2 is even
  2. Divide the result by 2 = 1
  3. 1 is odd. Add 11 to it = 12.
  4. Calculate the modulo 7 = 5
  5. Subtract this remainder from 7. 7 -5 = 2

Tuesday + 2 = Thursday as the year 2002′s Doomsday.

The 31st we know is one away, so the 31st of May 2002 must have been a Friday.

As I write this it’s the 16th of January 2012.
“20″ = Tuesday
12 = 12 / 2 = 6. 7 mod 6 = 6. 7 – 6 = 1.
Our year’s Doomsday is a Wednesday.
January in a leap year has a Doomsday of the 4th, The 11th will have been a Doomsday, so we are five away from Wednesday.

Therefore the 16th of January 2012 is a Monday.

This entry was posted in Calculations. Bookmark the permalink.

One Response to How to Calculate the Day of the Week for a Given Date

  1. Jack Ramirez says:

    thanks for a wonderful article! I like the perpetual calendar picture too.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>