E A S Y C A L E N D A R F O R M U L A E ================================================== 1. D - date in the month D --> CD (mod 7) (The remaider when divided by 7) CD - Correction for the date (0-6) -------------------------------------------------- 2. Month CM - Correction for the month (0-6) y e a r leap usual January 0 1 2 February 3 4 ( 144 = 12 ) March 4 April 0 2 May 2 ( 025 = 5 ) June 5 July 0 2 August 3 ( 036 = 6 ) September 6 October 1 2 November 4 ( 146 = 12 + 2 ) December 6 -------------------------------------------------- Month J F M A M J J A S O N D +-------------------------------+ | 1 4 | usual CM | 4 0 2 5 0 3 6 1 4 6 | any year | 0 3 | leap +-------------------------------+ CM - Correction for the month (0-6) -------------------------------------------------- -------------------------------------------------- 3.1. First (restricted) variant for the year (for the period March 1, 1900 - February 28, 2100) Y - year YY = Y - {1884,1912,1940,1968,1996,2024,2052,2080} YY + [ YY / 4 ] --> CY (mod 7), ([ ] - the integer part) CY - Correction for the year (0-6) -------------------------------------------------- 3.2. Second (universal) variant for the year (for years > 0, i.e. A.D., old and new style) Y - year - - - - - - - - - - - - - - - - - - - - - - - - - 3.2.1. Full centuries Y1 = [Y/100] ([ ] - the integer part) .................................................. 3.2.1.1. Old style (last date October 4, 1582) 6 * Y1 + 3 --> CY1 CY1 - Correction for the century (0-6) .................................................. 3.2.1.2. New style (first date October 15, 1582) 5 * Y1 + [Y1/4] + 5 --> CY1 (mod 7) ([ ] - the integer part) CY1 - Correction for the century (0-6) - - - - - - - - - - - - - - - - - - - - - - - - - 3.2.2. Year in the century Y2 = the last two digits of Y or Y2 = Y - 100*Y1 or Y --> Y2 (mod 100) (00-99) Y2 + [Y2/4] --> CY2 (mod 7) ([ ] - the integer part) CY2 - Correction for the year in the century (0-6) - - - - - - - - - - - - - - - - - - - - - - - - - 3.2.3. CY1 + CY2 --> CY (mod 7) CY - Correction for the year (0-6) -------------------------------------------------- 4. CD + CM + CY --> DW (mod 7) DW - Day of the week (0-6) 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday ================================================== NOTE: LEAP years in the old as well as in the new style are those which can be divided by 4 without remainder. There are EXCEPTIONS only for the new style: the exact centuries (ending with 00) are NOT leap years if they cannot be divided by 400 without remainder. ================================================== FORMULA FOR THE MONTH CORRECTION ! January = 13-th month of the PREVIOUS year! February = 14-th month of the PREVIOUS year! M - Month (3-14) 3 + 2*M + [3*(M+1)/5] --> CM (mod 7) ([ ] - the integer part) In fact, this gives the following corrections: M CM 2 March 3 11 4 ( 4 = 2 ) April 4 14 0 2 May 5 16 2 ( 025 = 5 ) June 6 19 5 July 7 21 0 2 August 8 24 3 ( 036 = 6 ) September 9 27 6 October 10 29 1 2 November 11 32 4 ( 146 = 12 + 2 ) December 12 34 6 January 13 37 2 2 February 14 40 5 ( 25 = 5 ) -------------------------------------------------- ================================================== FULL FORMULAE using the formula for the month correction (suitable for computer programs): January = 13-th month of the PREVIOUS year! February = 14-th month of the PREVIOUS year! D - Date M - Month (3-14) Y2 - Year in the century (last two digits) Y1 - Full centuries ([year/100]) DW - Day of the week (0-6) 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday -------------------------------------------------- Old style 6 + D + 2*M + [3*(M+1)/5] + Y2 + [Y2/4] + + 6*Y1 --> DW (mod 7) ([ ] - the integer part) -------------------------------------------------- New style 1 + D + 2*M + [3*(M+1)/5] + Y2 + [Y2/4] + + 5*Y1 + [Y1/4] --> DW (mod 7) ([ ] - the integer part) ==================================================