x | Day |
---|---|
1 | Sunday |
2 | Monday |
3 | Tuesday |
4 | Wednesday |
5 | Thursday |
6 | Friday |
0 | Saturday |
Century | C |
---|---|
16th/20th | 0 |
17th/21st | 6 |
18th/22nd | 4 |
19th/23rd | 2 |
Every 400 years the days of the week repeat. July 5, 1995 was a Wednesday, so
July 5, 2395 will be a Wednesday again, for example.
Be careful: This algorithm works only for the Gregorian Calendar, so you can't
go back before October 15, 1582.
The following equivalent formula was suggested by Mike Keith. It involves fewer operations, but with higher numbers.
Y = y + (y div 4)
Example: The year 1995
Y = 95 + (95 div 4) = 95 + 23 = 118 = 6 (mod 7).
Both formulae can be generalized to the following method:
1. Find arbitrary natural numbers q and r that satisfy y = 12 * q + r.
2. Then compute Y = q + r + (r div 4).
The first formula uses the highest possible q, the second one immediately sets q=0 and r=y.
As q can be chosen arbitrarily in the range [0..(y div 12)], a good choice
depending on y may lead to an even easier mental computation.
Example: y=92
Choice: q=1 => Y = 1 + 80 + 20 = 101 = 3 (mod 7)
To further simplify the computation, you can compute y' = y mod 28 first
and then use y' instead of y in the formula.
95 mod 28 = 11, so for 1995 the calculation would be:
Y = (11 div 12) + (11 mod 12) + ((11 mod 12) div 4) = 0 + 11 + 2 = 13 = 6 (mod 7)
respectively
Y = 11 + (11 div 4) = 11 + 2 = 13 = 6 (mod 7)
OK, the computation is still nasty. Therefore Vidar Sveen (another member of the 1000-Club) suggested to me that it were probably better to memorize all year codes from 00 to 99.
Month | M |
---|---|
January | 1 [0] |
February | 4 [3] |
March | 4 |
April | 0 |
May | 2 |
June | 5 |
July | 0 |
August | 3 |
September | 6 |
October | 1 |
November | 4 |
December | 6 |
The numbers in brackets go for leap years.
Sorry, but you'll have to memorize this table.
If you can't memorize 14 digits,
go better find some less demanding home page.
By the way, it's such an easy sequence: 144 025 036 146 (12 squared, 5 squared,
6 squared , first number +2)
20th century => C=0 Year 95 => Y=6 Month November => M=4 Day 27 => D=27 C+Y+M+D = 0+6+4+27 = 37 = 2 (mod 7) = Monday
Whatever day of the week (DOW) March 0 (Last day of February) falls on, so do 4-4 (April 4), 6-6 (June 6), 8-8 (August 8), 10-10 (October 10), and 12-12 (December 12). Also falling on the same DOW are 9-5 (May 9), 7-11 (November 7), and their inverses 5-9 (September 5) and 11-7 (July 11).
Memory aid: "I hate my 9-to-5 job at the 7-11 Store."
So, if today is Wednesday, October 9, 1996, and you want to figure out what day was April 13, 1996, you just have to
calculate what 10-10 will be (tomorrow -> Thursday). Then 4-4 was also a Thursday,
so 13-4 is 9 days later, a Saturday.