Description of the Doomsday Algorithm
The algorithm is described in detail at http://rudy.ca/doomsday.html.
This is an algorithm that lets you easily determine the day of week for any date in the current year. It depends on fixed-interval relationships between the last day of February and days in other months. The last day in February is termed the “doomsday”, which in 2003 is a Friday. The rules are as follows:
For Even Numbered Months
For even numbered months, other than February, the easy rule to remember is that a doomsday falls on the nth of the nth month (April 4, June 6, August 8, October 10, December 12).
For Odd numbered Months
For May through November the rule is : 9-5 7-11, which you can remember with the mnemonic “I work from 9 to 5 at the 7-11”. Thus September 5, May 9, July 11, and November 7 are doomsdays.
For March, just remember that March 0 is the doomsday, and thus March 7, 14, 21, and 28 are doomsdays.
January is the only month affected by leap year, and you can remember that doomsday is on January 3 3 years out of 4, and on January 4 the other year.