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, 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 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 January 31 or 32 is a doomsday, and thus also January 3/4, 10/11, 17/18, and 24/25.
-- DaleBrayden - 07 Aug 2003
Current Rev: r1.1 - 07 Aug 2003 - 16:41 GMT - DaleBrayden, Revision History:Diffs | r1.1