How to quickly determine the day
of the week for a particular date
This is the method that I use now. I think that it is faster than
my older method.
For dates in 1900 through 2099, compute the day of the week as follows.
Subtract 1900.
To that number, add one
fourth of itself, discarding any remainder. This sum is the
year's
skew value
If the month in question is January or February in a leap year,
subtract 1 from the sum.
Add the date in the month.
Add the month's skew value from the following table:
0
January, October
1
May
2
August
3
February, March, November
4
June
5
September, December
6
April, July
The sum is the number of days after Sunday on which the date
falls.
Comments
All of the arithmetic in step
3 and later can be done modulo 7. In other words, if the sum is 7
or greater, subtract a multiple of 7 to get into the range 0-6.
The results of steps 1 and 2 depend only upon the year, so they can be
calculated in advance for the current year. For 2004, the year's
skew value is 4. This can be memorized by adding it to Sunday,
and just remembering Thursday for 2004.
The monthly skew table groups all the months that start on the same day
of the week in a non-leap year, and therefore have the same calendars
(apart from differences in length).
For 1984 and after, you can subtract 1984 instead of 1900 in step 1 if
you
like.
The mnemonic "O MAN, June Saw July" may help you memorize the table.
The
months in the mnemonic are the contiguous months from May through
November
(basically motorcycle season in Minnesota). Then you just have to
remember
the groups of months with matching calendars in a non-leap year.
Dates in 2100-2199 can be processed in the same way, but one must
subtract one from step 2 to account for the fact that 2100 will not be
a leap year. Similarly, 2200-2299 must subtract two, and so
on. For those planning to live a very long time, note that 2400 will be a leap year. If
you're willing to work with negative numbers, you can also go backwards
to the nineteenth and eighteenth centuries, but only to 1752, which is
when the English-speaking world finally switched from the older Julian
calendar to the modern Gregorian. (Wednesday the second of
September 1752 was immediately followed by Thursday the fourteenth,
correcting for eleven too many leap years accumulated since Roman
times.)
Why it works
There are 365 days in a normal
(non-leap) year. 365 = 52 * 7 + 1. So the calendar advances
one
weekday per year after 1900, plus one extra day for every leap year.
In
leap years, the leap year correction for that year has to be discarded
for
dates in January and February, since those dates are not after the leap
day
(February 29th).
Examples
Example: June 6, 1944 (D-Day)
Subtract 1900: 1944 - 1900 = 44
Add one fourth of 44 to
itself: 44 + 11 = 55, which is 6 (modulo 7)
Although there was no remainder in step 2 and 1944 was thus a
leap year, June is not January or February, so no correction is needed.
Add the date in the month: 6 + 6 = 12, which is 5 (modulo 7)
Add June's skew value: 5 + 4 = 9, which is 2 (modulo 7)
Sunday + 2 = Tuesday
Example: July 20, 1969 (Moon landing)
Subtract 1900: 1969 - 1900 = 69
Add one fourth of 69 to
itself: 69 + 17 = 86, which is 2 (modulo 7)
There was a remainder in step 2, so 1969 was not a leap year, and
no correction would have been needed for July anyway.
Add the date in the month: 2 + 20 = 22, which is 1 (modulo 7)
Add July's skew value: 1 + 6 = 7, which is 0 (modulo 7)
Sunday + 0 = Sunday
Example: January 1, 2004
Subtract 1984: 2004 - 1984 = 20
Add one fourth of 20 to
itself: 20 + 5 = 25, which is 4 (modulo 7)
Subtract 1 for leap year correction of January, yielding 3
Add the date in the month: 3 + 1 = 4
Add January's skew value: 4 + 0 = 4
Sunday + 4 = Thursday
Example: December 25, 2003
Use the memorized day of Tuesday for 2003 as a base.
Add 5 for December to get Sunday.
25 is 4 (modulo 7); Sunday + 4 = Thursday.
In Thornton Wilder's Our Town, Emily gets to relive her
twelfth birthday, February 11, 1899, which the narrator claims was a
Tuesday. Is that right?
And a final example that shows
another application of the monthly skew table: Which months in 2003
have a
Friday the 13th?
The base day for 2003 is Tuesday.
Tuesday + 13 = Monday
Friday - Monday = 4
The only month with a skew of 4 is June.
The monthly skew table has other
uses. As an exercise for the reader, consider this question:
which months
in 2003 need six rows to print their calendars?