Calendar Calculation

Document Sample
Calendar Calculation Powered By Docstoc
					How to Become a Human Calendar
For details, please check:
http://litemind.com/how-to-become-a-human-calendar/

    1. Enter year and get year code:                  2. Enter Date and get Day of Week:
         Year        Year Code   Leap Year?           Date          Day of Week
         2009            3            -                11/18/2009    Wednesday

    Year codes 1950-2050, for reference:              Year Code                3
          Year       Year Code Leap Year?             Month Code               4
          1950            6              -            Day                     18
          1951            0              -            Sum                     25
          1952            2           LEAP            MOD 7                    4
          1953            3              -            Day of Week      Wednesday
          1954            4              -
          1955            5              -
          1956            0           LEAP
          1957            1              -
          1958            2              -
          1959            3              -
          1960            5           LEAP
          1961            6              -
          1962            0              -
          1963            1              -
          1964            3           LEAP
          1965            4              -
          1966            5              -
          1967            6              -
          1968            1           LEAP
          1969            2              -
          1970            3              -
          1971            4              -
          1972            6           LEAP
          1973            0              -
          1974            1              -
          1975            2              -
          1976            4           LEAP
          1977            5              -
          1978            6              -
          1979            0              -
          1980            2           LEAP
          1981            3              -
          1982            4              -
          1983            5              -
          1984            0           LEAP
1985   1     -
1986   2     -
1987   3     -
1988   5   LEAP
1989   6     -
1990   0     -
1991   1     -
1992   3   LEAP
1993   4     -
1994   5     -
1995   6     -
1996   1   LEAP
1997   2     -
1998   3     -
1999   4     -
2000   6   LEAP
2001   0     -
2002   1     -
2003   2     -
2004   4   LEAP
2005   5     -
2006   6     -
2007   0     -
2008   2   LEAP
2009   3     -
2010   4     -
2011   5     -
2012   0   LEAP
2013   1     -
2014   2     -
2015   3     -
2016   5   LEAP
2017   6     -
2018   0     -
2019   1     -
2020   3   LEAP
2021   4     -
2022   5     -
2023   6     -
2024   1   LEAP
2025   2     -
2026   3     -
2027   4     -
2028   6   LEAP
2029   0     -
2030   1     -
2031   2     -
2032   4   LEAP
2033   5     -
2034   6     -
2035   0     -
2036   2   LEAP
2037   3     -
2038   4     -
2039   5     -
2040   0   LEAP
2041   1     -
2042   2     -
2043   3     -
2044   5   LEAP
2045   6     -
2046   0     -
2047   1     -
2048   3   LEAP
2049   4     -
2050   5     -
Lookup tables:
Century Codes        Month Codes       Days of Week
     1600        6           1     1      0 Saturday
     1700        4           2     4      1 Sunday
     1800        2           3     4      2 Monday
     1900        0           4     0      3 Tuesday
     2000        6           5     2      4 Wednesday
     2100        4           6     5      5 Thursday
                             7     0      6 Friday
                             8     3
                             9     6
                            10     1
                            11     4
                            12     6