How to Calculate the Day of the Week from Any Date

Here is a calendar calculation technique that I learned from a book called Mind Performance Hacks. It allows you to take a date, like 14 March 1987, and mentally calculate which day of the week it fell on.

The Formula

The formula is:

(Year Code + Month Code + Century Code + Date Number – Leap Year Code) mod 7

Here’s How it Works

I’ll run through an example with the date, 14 March 1897 — Einstein’s birthday.

The Year Code

To calculate the Year Code, use this formula:

(YY + (YY div 4)) mod 7

YY is the last two digits of the year. For the year 1897, it’s 97.

First, divide YY by 4 and discard the remainder: 97 div 4 = 24.

Then add 24 back into the YY number, which is 97 in this case, resulting in 121.

The next step is: 121 mod 7.

Mod” means to divide the number and keep only the remainder. For 121 mod 7, start removing sevens:

  • 10 x 7 is 70, leaving us with 51, because 121 – 70 = 51.
  • 7 x 7 = 49, and 51 – 49 = 2.

We’ve removed all the sevens from 121 until we are left with a remainder of 2. That is the Year Code for 1897.

You could use a number shape image like a swan to hold that in memory while you calculate the items below.

The Month Code

This is easy — just memorize the number 033614625035:

  • January = 0
  • February = 3
  • March = 3
  • April = 6
  • May = 1
  • June = 4
  • July = 6
  • August = 2
  • September = 5
  • October = 0
  • November = 3
  • December = 5

Now you have the Month Code. For Einsteins birthday in March, it is 3.

A Quick Note on Memorizing Numbers

If you don’t know how to memorize a number like 033614625035, you could either use repetition or learn a mnemonic system like the Major System or Dominic System. I use my Ben System images: Samwise (033) throws a glass of beer (614) on George Boole (625) who falls backwards on Sally (035).

A way to quickly memorize 033614625035 without a complex mnemonic system would be to use a number shape system to associate images with each month. For example, you could picture a game of soccer (football) in January, with ball being a mnemonic image for zero. You could picture a butterfly in February and March, if you use a butterfly image for the number three. If the number six is represented by the image of an elephant, picture an elephant in April and July, and so on. If you are having trouble associating the images with the months, pick an aspect of each month to associate the image with. For example, Halloween is in October, so to remember that October has a Month Code of zero (represented by an image of a ball), you could picture a group of people in Halloween costumes doing something with a ball. That would link the month of October with the number zero.

The Century Code

You then need to apply an adjustment based on the century. In Great Britain, and what was to become the USA, the calendar system changed from the Julian Calendar to the Gregorian Calendar on 2 September 1752. The Gregorian Calendar began on 14 September 1752, skipping 11 days.

Gregorian Dates

For the Gregorian Calendar, remember the number 4206420:

  • 1700s = 4
  • 1800s = 2
  • 1900s = 0
  • 2000s = 6
  • 2100s = 4
  • 2200s = 2
  • 2300s = 0

If you are only doing this calendar trick with friends’ birthdays, you could probably leave this step out, because dates that fall in the 1900s get a Century Code of zero and don’t affect the outcome of the calculation.

Julian Dates

If you are looking at a Julian date, the formula is to take the century number and subtract it from 18 and then mod 7.

Example 1: if the year is 852 CE, take the century number, 8, and subtract it from 18, leaving 10. Then, 10 mod 7 =3.

Example 2: if the year is 1625 CE, take the century number, 16, and subtract it from 18, leaving 2. 2 mod 7 = 2, so in this case the Century Code is 2.

For Einsteins birthday in 1897, the Century Code is 2, because it’s a Gregorian date, and the chart above shows that dates in the 1800s get an adjustment of 2.

Leap Year Code

The other thing to take into account is whether you are dealing with a leap year. EDIT: If the date is in a January or February of a leap year, you have to subtract one from your total before the final step.

Gregorian Calendar

If you can divide a Gregorian year by 4, it’s a leap year, unless it’s divisible by 100. But it is a leap year if it’s divisible by 400.

1992 is a leap year because you can divide it by four.
1900 is not a leap year because you can divide it by 100.
2000 is a leap year because you can divide it by 400.

Julian Calendar

If you can divide a Julian year by 4, it’s a leap year.

Einstein’s birthday was in 1897 which was not a leap year (0), so it doesn’t affect the outcome.

Calculating the Day

Back to the original formula:

(Year Code + Month Code + Century Code + Date Number – Leap Year Code) mod 7

For 14 March 1897, here are the results:

  • Year Code: 2
  • Month Code: 3
  • Century Code: 2
  • Date Number: 14 (the 14th of the month)
  • Leap Year Code: 0

So:

(2 + 3 + 2 + 14) mod 7 = 21 mod 7 = 0

Match the resulting number in the list below, and you’ll have the day of the week:

  • 0 = Sunday
  • 1 = Monday
  • 2 = Tuesday
  • 3 = Wednesday
  • 4 = Thursday
  • 5 = Friday
  • 6 = Saturday

Einstein was born on a Sunday.

More Examples

Here are three more examples from different centuries:

The Moon Landing

Humans set foot on the moon: 20 July 1969:

  • Take ’69 and divide by 4, discarding the remainder. That leaves 17. Add 69 to 17 to get 86. Then, 86 mod 7 = 2. The Year Code is 2.
  • The Month Code for July is 6.
  • The Century Code for the 1900s is zero.
  • The Date Number is 20, because it’s the 20th of July.
  • 1969 wasn’t a leap year since it can’t be divided by 4.
  • 2 + 6 + 0 + 20 = 28
  • 28 mod 7 = 0

20 July 1969 was a Sunday.

The Battle of Hastings

The Battle of Hastings took place on 14 October 1066.

  • Take ’66 and divide by 4, ignoring the remainder: 16. Add 66 to 16 to make 82. 82 mod 7 makes a Year Code of 5.
  • October has a Month Code of zero.
  • The Day Number is 14.
  • The Century Code for this Julian date is 18 – 10 = 8. 8 mod 7 = 1.
  • 1066 was not a leap year.
  • Answer: 5 + 0 + 14 + 1 = 20. 20 mod 7 = 6

14 October 1066 was a Saturday.

Beginning of the 21st Century

1 January 2000:

  • Start with ’00, leaving a Year Code of zero.
  • January has a Month Code of zero.
  • The Day Number is 1.
  • The Century Code for dates in the 2000s is 6.
  • 2000 is a leap year, since it can be divided by 400, and the date is in a January or February, so subtract 1 from the total in the final step.
  • Answer: 0 + 0 + 1 + 6 – 1 = 6.

1 January 2000 was a Saturday.

If you have any questions, please leave a comment below. There are also some shortcuts and tips in the Mentat Wiki — scroll down to the section titled, “The Classic Formula”.

Share and Enjoy

    Related posts:

    39 comments

    • This has a very practical application. I use this technique at my job while recording labs and writing medication orders.

    • When i calculate the The Moon Landing with the julian calendar the result is Monday.
      The difference comes from the century code. Am i wrong?

    • For any date in the 1900s, the Century Code is zero. If you change that number, you won’t get the same answer — or are you asking something different?

    • Sorry, I made a mistake in the post. You only subtract 1 in a leap year if the date is in January or February. I’ve updated the post.

    • please what if the year is1902 or 1905, how will you get the year code when you are to divide by 4

    • I am trying to calculate 15/jan/2004..

      Take 04 and divide by 4, ignoring the remainder: 01. Add 04 to 01 to make 05. 05 mod 7 makes a Year Code of 00.
      Jan has a Month Code of zero.
      The Day Number is 15.
      The Century Code 6
      2004 is a leap year.
      Answer: 0 + 0 + 15 + 6 – 1 = 23. 20 mod 7 = 6

      6 Means Saturday ….. But as per Calendar on 15/Jan/2004 day was Thursday …

      Am I doing something wrong here ??

      Bhupesh

    • @Robert:
      For 1902: (02 + (02 div 4)) mod 7 = (2 + 0) mod 7 = 2
      The fraction, 2/4, is dropped.

      So:
      1901 = 1
      1902 = 2
      1903 = 3
      1904 = 5

      @Bhupesh:
      5 mod 7 = 5
      http://www.wolframalpha.com/input/?i=5+mod+7

      See if it works with that change.

    • 5/12/2015?? if i calculate,the day wil come as a wrong.

    • It works for me. Try again and if it still doesn’t work, post all the steps of your calculation in a comment here.

    • Ritvij Kumar Sharma

      What is the logic of finding the month code and century code?

    • I don’t know the math explanations behind the technique, but if you ask that question in the forum, someone may be able to answer that question. (I suspect that Kinma or GreyMatters would know.)

    • Pls explain logic of the month code

    • Sudhakaran Puthiyapurayil

      14 March 1987
      Sir,
      There is no need to do that much calculation. 20th century ( AD 1900 Jan 1st was on Monday.
      1901 Jan 1st on Tuesday, 1902 Jan 1st on Wednesday and 1903 Jan 1st on Thursday. Each year will
      be repeated after 28 years. Here it will be repeat three times. 1903+28+28+28=1987
      1987 Jan1st was Thursday. May 1st Friday, Aug 1st Saturday and Mar 1st Sun day. Mar 8th and 15th
      also Sunday. So, 14 march 1987 was on Saturday.

    • Sudhakaran Puthiyapurayil

      Each century starting in a particular days. If 20th century starting on Monday the 18th century on Friday. It was worked out myself. I prepared such book from it we can find out any day and date up to
      AD 4000 within seconds ( 41st Century) since the Gregorian Calendar was instituted.( 1582 Oct 15)
      It is just like a dictionary.

    • Harshit Pathak

      Hi,
      its working perfectly for every other year but not with leap years…
      for example 28-Aug-2004
      (0+2+6+28-0) mod 7
      36 mod 7
      1 = Monday
      but it was a Saturday
      plz clear the concept of leap years

    • Harshit Pathak

      My Bad…
      got the answer
      thanx anyway
      i guess

    • Sudhakaran Puthiyapurayil

      from my book to find out the day of any date need not to do any calculation. it too easy than to find the meaning of a word from the dictionary. If you don’t believe , ask me any date and immediately a I
      will give the correct answer.

      Thanking you, P.P Sudhakaran

    • Quite a nice trick…I am my own calendar now..Im now a walking calendar.

    • sudhakaran puthiya purayil

      Mr. Sadasivsm, hi, u r not getting the correct answer of 5/12/2015? ok 2015 dec 1st was on Tuesday and 2nd Wed, 3rd Thu, 4th Fri and 5th Sat day. I am giving small calaendar for example 2015.

    • sudhakaran puthiya purayil

      And if u want know day of 5/12/ 2016 that is on Monday and 5 /12/ 2017 on Tues day, and 5/12/2035 is on Wed day. No need to do so many calculation. I prepared such a book” named calendar for ever” from which u can find out any day of date within seconds since the gregorian calendar was instituted.
      U need not to do any calculation. it is more easy than to find out a word’s meanig from the dictionery.

    • chandrasekhar

      helo…sir
      it is working correctly on other years…but not in leap year
      for ex: 16 july 1776
      (0+6+4+16) mod 7=26
      26 mod 7=5
      5 refers to friday..
      but it was tuesday..
      can u explain this..?

    • Rahul Vashisth

      Thanks!! Very usefull tricks and you save my lot of times….

    • @chandrasekhar,

      16 july 1776 was a Tuesday. Try doing the calculation again from the beginning.

      (Year Code + Month Code + Century Code + Date Number – Leap Year Code) mod 7

      (4 + 6 + 4 + 16 – 0) mod 7 =
      30 mod 7 =
      2 (Tuesday)

      I think you have an incorrect result for the year code.

      (YY + (YY div 4)) mod 7

      (76 + (76 div 4)) mod 7 =
      (76 + 19) mod 7 =
      95 mod 7 =
      4 (not zero)

    • Ho to calculate tha day on 7 nov 1786

    • 7 nov 1786

      You need to do this calculation:
      (Year Code + Month Code + Century Code + Date Number – Leap Year Code) mod 7

      Find the codes:

      Year code: (YY + (YY div 4)) mod 7
      (86 + (86 div 4)) mod 7
      (86 + 21)) mod 7
      96 mod 7
      = 2

      Month code: 3

      Century code: 4

      Leap Year: False (0)

      Now put it together:
      (Year Code + Month Code + Century Code + Date Number – Leap Year Code) mod 7

      (2 + 3 + 4 + 7 – 0) mod 7

      16 mod 7 = 2

      2 means Tuesday

      7 nov 1786 was a Tuesday

    • how to calculate for 6 march 2004?

    • @Aruna: Please post the calculation that you have attempted, and we could take a look to see where there might be a mistake.

    • Einstein’s birthday is 1879, not 1897 … thank you.

    • Hi everyone,

      I wanted to make a point for programmers who will use this nice formula to be careful with the Leap Year Code calculations. Subtracting 1 for the leap year could give you an unwanted negative value. This problem can be easily fixed by checking for a subtotal of 0 before subtracting the Leap Year Code. In this case you want your final answer to be 6 or Saturday. To illustrate my point look at what happens when you calculate for the week day February 27, 2016:

      Start with ’16, leaving a Year Code of 6: YY = (16 + 16/4)%7 = 6
      February has a Month Code of 3.
      The Day Number is 27.
      The Century Code for dates in the 2000s is 6.
      2016 is a leap year, since it can be evenly divided by 4, and the date is in a January or February, so subtract 1 from the total in the final step.
      Answer: ((6 + 3 + 27 + 6)%7 )– 1 = 0 – 1 = -1

    • @gary: thanks for catching that. 🙂

      I’ll update the post soon.

    • Can you please demonstrate your algorithm for 02-sep-1752 and 14-sep-1752

    • There seems to be an error when trying to calculate the day from a leap year.
      For example – Friday 14th October 2016
      Year code: 16/4=4, 4+16=20, 20Mod7=6
      Month code: 10
      Century code: 6
      Date Number: 14
      Leap Year code: 1
      Therefore – (6+10+6+14-1)=35, 35Mod7=0, 0=Sunday
      However the day is Friday, not Sunday.

      I’ve also tried numerous other leap year dates but have had no success. Please try and find a solution to the leap year errors.

    • How would u calculate 6th April 2003.or a earlier date.

      Thanks

    • @mike @sharjeel: please post the exact steps showing your work, so I can see where you might be making a mistake. I’m happy to write out examples if people show their work.

      @Christian: check the leap year rules again:

      “If the date is in a January or February of a leap year, you have to subtract one from your total before the final step.”

      So:
      14 Oct 2016

      (16 + (16 // 4)) % 7
      (16 + 4) % 7
      20 % 7
      Year Code: 6

      Month = 0
      Century = 6
      Leap year = 0 (not Jan or Feb)

      (6 + 0 + 6 + 14 – 0) % 7

      26 % 7 = 5
      = Friday

    • Hello josh

      03 cant divide by 4 thats what i want to know.tell me first step please .
      Thanks

    • kindly tell i have two thing date 5 month september how find date

    • N.V. DURGA PRASAD

      for january and feb. months we have to subtract 1 for leap years what about the remaining months. please give me the leap year codes which we have to subtract finally to get the formula

    • Something seems off about certain dates I’ve calculated in the 1600s..

      There’s a pattern though.
      (If I count 4 days forward then it’s the right answer every time)
      Assuming it has to do with the 11-day discrepancy for the Julian/Gregorian split. (??) Feel free to weigh in though!

      Example – October-07, 1644
      Month-Code: ——-0
      Date-Number-“Code”: ——-7
      Century-Code: ——-2
      18-16=2
      2 mod7 = 2
      Year-Code: ——-6
      (44 + 44/4) mod7
      55 mod7
      55-49= 6
      Leap-Year-Code: ——-0
      (Not Jan or Feb
      Formula
      (0 + 7 + 2 + 6 -0) mod7
      15 mod7
      15-14= 1
      1=Monday
      Result: Monday
      Siri says Friday
      Internet Says Friday

      (4 days difference)
      ( Same for these dates also.. )
      October-07, 1645
      September-07, 1644
      September-07, 1601
      September-08, 1601

    • i understand to subtract 1 if it’s a leap year and the month is jan or feb.. but when it ll be nov aug dec in a leap year then?????

    Leave a Reply

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