FACTOID # 171: Want to go to the United States? Try going to Albania first. Albania has more U.S visa lottery winners per capita than anywhere else in the world.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Calculating the Day of the Week

This article details various mathematical algorithms to calculate the day of the week for any particular date in the past or future. In mathematics, computing, linguistics, and related disciplines, an algorithm is a finite list of well-defined instructions for accomplishing some task that, given an initial state, will terminate in a defined end-state. ... Look up day in Wiktionary, the free dictionary. ... For more details on each day of the week, see days of the week. ...


A typical application is to calculate the day of the week on which someone was born or some other special event occurred.

Contents

Introduction

The basis of nearly all the algorithms to calculate the day of the week is:

  1. Use arithmetic modulo 7 to add the number of days elapsed since the start of a known period (usually in practice a century). If we number the days of the week from 0 to 6 the result is some modulo value; if we use the range from 1 to 7, then 7 replaces 0.
  2. To look up or calculate using a known rule what day the given century started on.
  3. To look up or calculate what day the given year in that century started on.
  4. To look up or calculate what day the given month in that year in that century started on.
  5. To then add on the day of the month - this of course being the days elapsed since the month started.

Put simply, using arithmetic modulo 7 means ignoring multiples of 7 during calculations. Thus we can treat 7 as 0, 8 as 1, 9 as 2, 18 as 4 and so on; the interpretation of this being that if we signify Sunday as day 0, then 7 days later (i.e. day 7) is also a Sunday, and day 18 will be the same as day 4, which is a Thursday since this falls 4 days after Sunday. Some algorithms do all the additions first and then cast out sevens whereas others cast them out at each step. Either way is quite permissible; the former is better when using calculators and in computer algorithms, the latter for mental calculation (it is quite possible to do all the calculations in one's head with a little practice). Modular arithmetic (sometimes called modulo arithmetic, or clock arithmetic because of its use in the 24-hour clock system) is a system of arithmetic for integers, where numbers wrap around after they reach a certain value — the modulus. ... Mental calculation is the practice of doing mathematical calculations using only the human brain, with no help from any computing devices. ...


Useful concepts

Corresponding months

"Corresponding months" are those months within the calendar year that start on the same day. For example, September and December correspond, because September 1 falls on the same day as December 1. Months can only correspond if the number of days between their first days is divisible by 7, or in other words, if their first days are a whole number of weeks apart. For example, February corresponds to March because February has 28 days, a number divisible by 7, 28 days being exactly four weeks. In a leap year, January and February correspond to different months than in a common year, since February 29 means each subsequent month starts a day later. is the 244th day of the year (245th in leap years) in the Gregorian calendar. ... is the 335th day of the year (336th in leap years) in the Gregorian calendar. ... For the 1921 film starring Fatty Arbuckle, see Leap Year (film). ... A common year is a year that is common calendar year. ... February 29 is a day added into a leap year of the Gregorian calendar. ...


Here's how the months correspond:

  • Common year
    • January and October.
    • February, March and November.
    • April and July.
    • No month corresponds to August.
  • Leap year
    • January, April and July.
    • February and August.
    • March and November.
    • No month corresponds to October.
  • All years
    • September and December.
    • No month corresponds to May or June.

Note that in the months table below, corresponding months have the same number, a fact which follows directly from the definition.


Corresponding years

There are 7 possible days that a year can start on, and leap years will alter the day of the week after February 29. This means that there are 14 configurations that a year can have. All the configurations are referenced in the article on Dominical letter. For example, 2007 is a common year starting on Monday, meaning that 2007 corresponds to the 2001 calendar year. 2008, on the other hand, will be a leap year starting on Tuesday, meaning that the year starts off corresponding to 2002, but after February, corresponds to 2003. February 29 is a day added into a leap year of the Gregorian calendar. ... The days of the year are sometimes designated letters A, B, C, D, E, F and G in a cycle of 7 as an aid for finding the day of week of a given calendar date and in calculating Easter. ... This is the calendar for a common year starting on Monday (dominical letter G), e. ... According to the Gregorian calendar, the calendar year begins on January 1 and ends on December 31. ... This is the calendar for a leap year starting on Tuesday (dominical letter FE) January February March Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 4 5 1 2 1 6 7 8 9...


An algorithm to calculate the day of the week

The algorithm is valid for the Gregorian calendar. This began in Britain and her colonies on September 14, 1752. The area now forming the United States changed at different times depending on the colonial power; Spain, France, Italy, and others had changed in 1582 and Russia had not changed by 1867 when Alaska was purchased by the U.S. from Russia. For the calendar of religious holidays and periods, see liturgical year. ... is the 257th day of the year (258th in leap years) in the Gregorian calendar. ... 1752 was a leap year starting on Saturday (see link for calendar). ... For other uses, see Alaska (disambiguation). ...


It should be noted that, in this algorithm, the days on which the century, year, and month start are the "zeroth" day. This allows us to add the day of the month directly (without subtracting 1). For example, 1900 starts on day 0 which corresponds to a Sunday; however, we still need to add 1 for the January 1 which brings the day on which January 1, 1900 fell to day 1, which is Monday, the correct day. is the 1st day of the year in the Gregorian calendar. ... is the 1st day of the year in the Gregorian calendar. ... Äž: For the film, see: 1900 (film). ...

  • Centuries First, we can either refer to the centuries table below or use the rule: Divide centuries-figure by 4, take the remainder from 3, then multiply the result by 2.
    • For example, for years beginning 18 (1800-1899), 18/4 gives remainder 2, 3-2=1 then 2*1 = 2.
  • Years Because there are 365 days in a common year, which is 52 weeks plus 1 day, each year will start on the day of the week after that starting the preceding year. Each leap year has of course one more day than a common year. Assuming we know on which day a century starts (from above), if we add the number of years elapsed since the start of the century, plus the number of leap years that have elapsed since the start of the century, we get the day of the week on which the year starts.
    • Taking 1978 as an example, 78 common years would add 78 to the start-day of the century, but 78/4 = 19.5 meaning that there have been 19 leap years since 1900 (we can ignore the remainder since the 2 years since 1976 contribute no extra leap-day). So 1978 started on day 0 + 78 + 19 = 97 which is the same as day 6.
    • Alternatively, divide the year by twelve, add the remainder to the quotient, and add the number of times four goes into the remainder. For 1978: 78/12 = 6 remainder 6. 4 goes into 6 once and 6 + 6 + 1 = 13, which is the same day as 6.
  • Months We refer to the months table below to work out on which day of the week a month starts. Notice that January starts on day 0, which is simply another way of saying that the year and January of that year start on the same day. The months table shown allows for leap years; other algorithms leave the correction to the end and then deduct 1 from the final figure if the month is a January or February of a leap year.
  • Day of the Month Once we know on which day of the week the month starts, we simply add the day of the month to find the final result (noting that as mentioned above, we've been working with the "zeroth" day of the month as the start). For example, January 22 will be 22 days after the start of January, so we add 22.

is the 22nd day of the year in the Gregorian calendar. ...

Examples

Now for an example of the complete algorithm, let's use April 24, 1982. is the 114th day of the year (115th in leap years) in the Gregorian calendar. ... Year 1982 (MCMLXXXII) was a common year starting on Friday (link displays the 1982 Gregorian calendar). ...

  1. Look up the 1900s in the centuries table: 0
  2. Note the last two digits of the year: 82
  3. Divide the 82 by 4: 82/4 = 20.5 and drop the fractional part: 20
  4. Look up April in the months table: 6
  5. Add all numbers from steps 1-4 to the day of the month (in this case, 24): 0+82+20+6+24=132.
  6. Divide the sum from step 5 by 7 and find the remainder: 132/7=18 remainder 6
  7. Find the remainder in the days table: 6=Saturday.

Now let's try September 18, 1783. is the 261st day of the year (262nd in leap years) in the Gregorian calendar. ... 1783 was a common year starting on Wednesday (see link for calendar). ...

  1. Look up the 1700s in the centuries table: 4
  2. Note the last two digits of the year: 83
  3. Divide the 83 by 4: 83/4 = 20.75 and drop the fractional part: 20
  4. Look up September in the months table: 5
  5. Add all numbers from steps 1-4 to the day of the month (in this case, 18): 4+83+20+5+18=130.
  6. Divide the sum from step 5 by 7 and find the remainder: 130/7=18 remainder 4
  7. Find the remainder in the days table: 4=Thursday.

Finally, let's try June 19, 2054 is the 170th day of the year (171st in leap years) in the Gregorian calendar. ... 2054 (MMLIV) will be a common year starting on Thursday of the Gregorian calendar. ...

  1. Look up the 2000s in the centuries table: 6
  2. Note the last two digits of the year: 54
  3. Divide the 54 by 4: 54/4 = 13.5 and drop the fractional part: 13
  4. Look up June in the months table: 4
  5. Add all numbers from steps 1-4 to the day of the month (in this case, 19): 6+54+13+4+19=96.
  6. Divide the sum from step 5 by 7 and find the remainder: 96/7=13 remainder 5
  7. Find the remainder in the days table: 5=Friday.

Centuries table

 1700-1799 4 (Still Julian Calendar in Great Britain and its lands until 1752) 1800-1899 2 1900-1999 0 2000-2099 6 2100-2199 4 2200-2299 2 2300-2399 0 2400-2499 6 2500-2599 4 

Months table

 January 0 (in leap year 6) February 3 (in leap year 2) March 3 April 6 May 1 June 4 July 6 August 2 September 5 October 0 November 3 December 5 

Days table

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

One can add constants (modulo 7) to these three tables provided the constant you add to the day table is equal to the sum of the constants you add to the centuries table and the months table modulo 7.


Mental calculation

An easy way to do the calculation in your head is to imagine the year starts on March 1 rather than January 1 (as it did in Roman times), so that the extra day in a leap year is the last day, rather than occurring in the middle of the year. That is, "day 0" described above is the last day of February. is the 60th day of the year (61st in leap years) in the Gregorian calendar. ... is the 1st day of the year in the Gregorian calendar. ...


April 4, June 6, August 8, October 10 and December 12 all occur on the same day as day 0 (note that April is the 4th month, June the 6th, August the 8th, etc). is the 94th day of the year (95th in leap years) in the Gregorian calendar. ... is the 157th day of the year (158th in leap years) in the Gregorian calendar. ... is the 220th day of the year (221st in leap years) in the Gregorian calendar. ... is the 283rd day of the year (284th in leap years) in the Gregorian calendar. ... is the 346th day of the year (347th in leap years) in the Gregorian calendar. ...


May 9 and September 5 are also the same day as day 0 (May is the 5th month and September the 9th — think of the Dolly Parton song "9 to 5": the 9th day of the 5th month and the 5th day of the 9th month). is the 129th day of the year (130th in leap years) in the Gregorian calendar. ... is the 248th day of the year (249th in leap years) in the Gregorian calendar. ... Dolly Rebecca Parton (born January 19, 1946) is a Grammy-winning and Academy Award-nominated American country singer, songwriter, composer, musician, author, actress, and philanthropist. ... 9 to 5 is the title of a hit song for the 1980 film comedy Nine to Five starring Jane Fonda, Lily Tomlin and, in her film debut, Dolly Parton. ...


July 11 and November 7 are the same day as day 0 (the 7th and 11th months, respectively -- think of the 7-Eleven shops). is the 192nd day of the year (193rd in leap years) in the Gregorian calendar. ... is the 311th day of the year (312th in leap years) in the Gregorian calendar. ... For other uses, see 7-Eleven (disambiguation). ...


This day of the week is called Doomsday in the Doomsday algorithm, which uses these very same mnemonics. The Doomsday algorithm is a way of calculating the day of the week of a given date. ...


However, if one regards the new year as beginning on March 1 one has a simpler situation for February and January. January 16 and February 6 are the same day of the week as the previous last day of February (i.e. last year's Doomsday) for every year. is the 60th day of the year (61st in leap years) in the Gregorian calendar. ... is the 16th day of the year in the Gregorian calendar. ... is the 37th day of the year in the Gregorian calendar. ...


Also within each year beginning March 1, five months is always exactly 153 days and hence one day short of a whole number of weeks. This gives rise to the following dates on the same day of week starting with April 4, June 6 etc. is the 60th day of the year (61st in leap years) in the Gregorian calendar. ... is the 94th day of the year (95th in leap years) in the Gregorian calendar. ... is the 157th day of the year (158th in leap years) in the Gregorian calendar. ...

 Month +5 months -5 months +10 Months April 4 September 5 February 6 June 6 November 7 August 8 January 9 March 7 October 10 May 9 December 12 July 11  

So if you can figure out what day "day 0" is, you can quickly find a date in any month that falls on the same day, and you only have to add or subtract a few days to get to any other day in the month. is the 94th day of the year (95th in leap years) in the Gregorian calendar. ... is the 248th day of the year (249th in leap years) in the Gregorian calendar. ... is the 37th day of the year in the Gregorian calendar. ... is the 157th day of the year (158th in leap years) in the Gregorian calendar. ... is the 311th day of the year (312th in leap years) in the Gregorian calendar. ... is the 220th day of the year (221st in leap years) in the Gregorian calendar. ... is the 9th day of the year in the Gregorian calendar. ... is the 66th day of the year (67th in leap years) in the Gregorian calendar. ... is the 283rd day of the year (284th in leap years) in the Gregorian calendar. ... is the 129th day of the year (130th in leap years) in the Gregorian calendar. ... is the 346th day of the year (347th in leap years) in the Gregorian calendar. ... is the 192nd day of the year (193rd in leap years) in the Gregorian calendar. ...


Memorise this: in 2000, day 0 was a Tuesday. Every century, day 0 changes according to the following pattern: Tuesday, Sunday, Friday, Wednesday, Tuesday, Sunday, Friday, Wednesday, ... (mnemonic: "it's Too Sunny For Work" - "too" for Tuesday); i.e., in 2100 day 0 will be Sunday; in 1900 it was Wednesday. Every common year, day 0 moves forward one day, and two days every leap year; it moves ahead one day every 12 years (2000 is a Tuesday, 2012 is a Wednesday, 2024 is a Thursday, etc.). Also convenient can be that one can ignore periods of 28 years as long as they are within a century or across 2000: 1972 and 2028 are also Tuesday.


So let's say you want to know what day June 3, 2017 will be. Day 0 for 2000 was a Tuesday, in 2012 it will be Wednesday, 2013 will be Thursday, 2014 Friday, 2015 Saturday, 2016 (a leap year) Monday, and 2017 Tuesday; June is the 6th month, so the 6 June is a Tuesday. Three days earlier is Saturday. is the 154th day of the year (155th in leap years) in the Gregorian calendar. ... 2017 (MMXVII) will be a common year starting on Sunday of the Gregorian calendar. ... is the 157th day of the year (158th in leap years) in the Gregorian calendar. ...


Marshall House's Formula (points version)

This is a brand new and original formula for calculating the day of the week and you will be very pleased on how simple it is and that you can do it without a pen and paper. First we assign a numerical point system to each month, not difficult to memorize as long as you know which months have 30 and which months have 31 days... All of the months with 31 days get 3 points and all the months with 30 get 2 points and february has 0 points on a common year and 1 point on leap year. Now in this formula you can start with any known date such as 3/3/08 which i know is a monday.. it could be any date. Say we wanted to know what day of the week 11/17/2040 would be.


To start we figure out how many days remain in march, since march has 31 days and 3 of them are gone there are 28 days remaining so we have 28 points. Now we take how many days we are into the ending month which is 17 and add it to 28 which sums up to 45 so now we have 45 points and now the easy part... Take the months between march and november which are:


april, may, june, july, august, september, october.


And this is where the points i mentioned earlier come into play the months with 31 days each get 3 points so that adds up to be 12 plus 2 points for the other months which is 6 points, so 18 points total from that. Now add the 18 to the 45 to get 63 points.


With the 63 points we divide by 7 and use the remainder which happens to be 0, which means our starting day is still monday (this can change but not in this instance). Now since it is 2008 there are 32 years until 2040, now we multiply 32 by 1.25 which accounts for leap year as long as you dop the fraction of a point if there is one, however if the date you start (your known date) is not on a leap year (after february 29th and before december 31st of that year) you must add .25 points for every year since the last leap year, so if it is 2011 you must add .75 points, 2010 you must add .5 points. (do that after multiplying by 1.25).. continuing on 32 x 1.25 = 40 and since the points from calculating earlier came to zero we now have 40 points, again you divide by 7 and hold the remainder which is 5 all you have to do now is remember your starting day which was a monday and add 5 so.. tues wed thurs fri sat. The 5th day from monday is saturday, so that means that November 17th of 2040 is a Saturday! This formula can work backwards but needs to be completely reversed by subtracting instead of adding and so on.


Babwani's formula

Sohael S. Babwani's [1] method of finding the weekday was published in The Mathematical Gazette, London in November 2004. He developed alternative formulae which are easier to use and also allow one to find the date, month and year when the other information is given. The other known methods cannot find the other way round and are too complex to understand.


In Zeller’s algorithm the months are numbered from 3 for March to 14 for February. The year is assumed to begin in March; this means, for example, that January 1995 is to be treated as month 13 of 1994. But in Babwani's method of finding the weekday, the months are numbered properly 1 for January to 12 for December. See "An extended approach to the Julian and the Gregorian calendar" for a lot of details to do various calculations.


Dominical letters

The system of dominical letters assigns a letter from A through G to each day of the year. In a leap year, February 24, the bissextile day, does not have a distinct letter. This causes all subsequent Sundays to be associated with a different dominical letter than those in the beginning of the year, so all leap years get two dominical letters. In this system, the "dominical letter" for a year is the letter which corresponds to the Sundays of that year. The days of the year are sometimes designated letters A, B, C, D, E, F and G in a cycle of 7 as an aid for finding the day of week of a given calendar date and in calculating Easter. ... is the 55th day of the year in the Gregorian calendar. ...


See also

ISO 8601 is an international standard for date and time representations issued by the International Organization for Standardization (ISO). ... The Doomsday rule or Doomsday algorithm is a way of calculating the day of the week of a given date. ... Zellers congruence is an algorithm devised by Christian Zeller to calculate the day of the week for any calendar date. ... A perpetual calendar is a calendar which is good for a span of many years, such as the Runic calendar. ... “JDN” redirects here. ... This article does not cite any references or sources. ...

External links


  Results from FactBites:
 
Calculating the day of the week - Wikipedia, the free encyclopedia (2285 words)
3 The algorithm to calculate the day of the week
The algorithm to calculate the day of the week
January 16 and February 6 are the same day of the week as the previous last day of February (i.e.
Gregorian calendar (3973 words)
This is 365;14,33 days in sexagesimal notation - the length of the tropical year, rounded to two sexagesimal positions; this was the value used in the major astronomical tables of the day.
Although close to the mean tropical year of 365.2422 days, it is even closer to the vernal equinox year of 365.2424 days; this fact made the choice of approximation particularly appropriate as the purpose of creating the calendar was to ensure that the vernal equinox would be near a specific date (March 21).
The day of the week was repeated on successive days because the International Date Line was shifted from east of to west of Alaska along with the change to the Gregorian calendar.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.