Christmas Day

created by FishHead
(idea) by m_turner (1.7 y) (print)   ?   (I like it!) Sat Dec 23 2000 at 6:13:14
So, what day of the week does Christmas day fall on?
  1. Select the year you are interested in. Break this into two parts: Century and Year.
    example: 2001 becomes C = 20, and Y becomes 01.
  2. Divide C by 4 and truncate. Store the result into K.
    example: K = C/4 = 20/4 = 5
  3. Divide Y by 4 and truncate. Store the result into G.
    example: G = Y/4 = 1/4 = 0
  4. D = 50 + Y + K + G - (2 * C)
    example: 50 + 1 + 5 + 0 - 40 = 16
  5. Take the remainder of D/7 (or take the modulo: D % 7) example: 16 % 7 = 2
  6. Lookup:
Please note that this applies only to the Gregorian calendar that was first introduced in 1582.
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.