Doomsday rule
The Doomsday rule, Doomsday algorithm or Doomsday method is an algorithm of determination of the day of the week for a given date. It provides a perpetual calendar because the Gregorian calendar moves in cycles of 400 years. The algorithm for mental calculation was devised by John Conway in 1973, drawing inspiration from Lewis Carroll's perpetual calendar algorithm. It takes advantage of each year having a certain day of the week upon which certain easy-to-remember dates, called the doomsdays, fall; for example, the last day of February, April 4, June 6, August 8, October 10, and December 12 all occur on the same day of the week in the year.
Applying the Doomsday algorithm involves three steps: determination of the anchor day for the century, calculation of the anchor day for the year from the one for the century, and selection of the closest date out of those that always fall on the doomsday, e.g., 4/4 and 6/6, and count of the number of days between that date and the date in question to arrive at the day of the week. The technique applies to both the Gregorian calendar and the Julian calendar, although their doomsdays are usually different days of the week.
The algorithm is simple enough that it can be computed mentally. Conway could usually give the correct answer in under two seconds. To improve his speed, he practiced his calendrical calculations on his computer, which was programmed to quiz him with random dates every time he logged on.
Doomsdays for contemporary years
Doomsday for the current year in the Gregorian calendar is. Simple methods for [|finding the doomsday of a year] exist.| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1796 | 1797 | 1798 | 1799 | 1800 | 1801 | |
| 1802 | 1803 | 1804 | 1805 | 1806 | 1807 | |
| 1808 | 1809 | 1810 | 1811 | 1812 | ||
| 1813 | 1814 | 1815 | 1816 | 1817 | 1818 | |
| 1819 | 1820 | 1821 | 1822 | 1823 | ||
| 1824 | 1825 | 1826 | 1827 | 1828 | 1829 | |
| 1830 | 1831 | 1832 | 1833 | 1834 | 1835 | |
| 1836 | 1837 | 1838 | 1839 | 1840 | ||
| 1841 | 1842 | 1843 | 1844 | 1845 | 1846 | |
| 1847 | 1848 | 1849 | 1850 | 1851 | ||
| 1852 | 1853 | 1854 | 1855 | 1856 | 1857 | |
| 1858 | 1859 | 1860 | 1861 | 1862 | 1863 | |
| 1864 | 1865 | 1866 | 1867 | 1868 | ||
| 1869 | 1870 | 1871 | 1872 | 1873 | 1874 | |
| 1875 | 1876 | 1877 | 1878 | 1879 | ||
| 1880 | 1881 | 1882 | 1883 | 1884 | 1885 | |
| 1886 | 1887 | 1888 | 1889 | 1890 | 1891 | |
| 1892 | 1893 | 1894 | 1895 | 1896 | ||
| 1897 | 1898 | 1899 | 1900 | 1901 | 1902 | 1903 |
| 1904 | 1905 | 1906 | 1907 | 1908 | ||
| 1909 | 1910 | 1911 | 1912 | 1913 | 1914 | |
| 1915 | 1916 | 1917 | 1918 | 1919 | ||
| 1920 | 1921 | 1922 | 1923 | 1924 | 1925 | |
| 1926 | 1927 | 1928 | 1929 | 1930 | 1931 | |
| 1932 | 1933 | 1934 | 1935 | 1936 | ||
| 1937 | 1938 | 1939 | 1940 | 1941 | 1942 | |
| 1943 | 1944 | 1945 | 1946 | 1947 | ||
| 1948 | 1949 | 1950 | 1951 | 1952 | 1953 | |
| 1954 | 1955 | 1956 | 1957 | 1958 | 1959 | |
| 1960 | 1961 | 1962 | 1963 | 1964 | ||
| 1965 | 1966 | 1967 | 1968 | 1969 | 1970 | |
| 1971 | 1972 | 1973 | 1974 | 1975 | ||
| 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | |
| 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | |
| 1988 | 1989 | 1990 | 1991 | 1992 | ||
| 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | |
| 1999 | 2000 | 2001 | 2002 | 2003 | ||
| 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | |
| 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | |
| 2016 | 2017 | 2018 | 2019 | 2020 | ||
| 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | |
| 2027 | 2028 | 2029 | 2030 | 2031 | ||
| 2032 | 2033 | 2034 | 2035 | 2036 | 2037 | |
| 2038 | 2039 | 2040 | 2041 | 2042 | 2043 | |
| 2044 | 2045 | 2046 | 2047 | 2048 | ||
| 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | |
| 2055 | 2056 | 2057 | 2058 | 2059 | ||
| 2060 | 2061 | 2062 | 2063 | 2064 | 2065 | |
| 2066 | 2067 | 2068 | 2069 | 2070 | 2071 | |
| 2072 | 2073 | 2074 | 2075 | 2076 | ||
| 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | |
| 2083 | 2084 | 2085 | 2086 | 2087 | ||
| 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | |
| 2094 | 2095 | 2096 | 2097 | 2098 | 2099 | |
| 2100 | 2101 | 2102 | 2103 | 2104 | 2105 |
Finding the day of the week from a year's doomsday
One can find the day of the week of a given calendar date by using a nearby doomsday as a reference point. To help with this, the following is a list of easy-to-remember dates for each month that always land on the doomsday.The last day of February is always a doomsday. For January, January 3 is a doomsday during common years and January 4 a doomsday during leap years, which can be remembered as "the 3rd during 3 years in 4, and the 4th in the 4th year". For March, one can remember either Pi Day or "March 0", the latter referring to the day before March 1, i.e. the last day of February.
For the months April through December, the even numbered months are covered by the double dates 4/4, 6/6, 8/8, 10/10, and 12/12, all of which fall on the doomsday. The odd numbered months can be remembered with the mnemonic "I work from 9 to 5 at the 7–11", i.e., 9/5, 7/11, and also 5/9 and 11/7, are all doomsdays.
John Conway wrote that: "Summary: 'Last' in Jan and Feb, otherwise nth in even months, in odd ones".
He clarified that: "The sign is + for long odd months, and − for short ones ".
Several well-known dates, such as Independence Day in United States, Boxing Day, Halloween and Valentine's Day in common years, also fall on doomsdays every year.
Since the doomsday for a particular year is directly related to weekdays of dates in the period from March through February of the next year, common years and leap years have to be distinguished for January and February of the same year.
Example
To find which day of the week Christmas Day of 2027 is, proceed as follows: in the year 2027, doomsday is on Sunday. Since December 12 is a doomsday, December 25, being thirteen days afterwards, will fall on a Saturday. Christmas Day is always the day of the week before doomsday. In addition, July 4 is always on the same day of the week as a doomsday, as are Halloween, Pi Day, and December 26.Mnemonic weekday names
Since this algorithm involves treating days of the week like numbers modulo 7, John Conway suggested thinking of the days of the week as "Noneday" or "Sansday", "Oneday", "Twosday", "Treblesday", "Foursday", "Fiveday", and "Six-a-day" to recall the number-weekday relation without needing to count them out in one's head.| Day of week | Index number | Mnemonic |
| Sunday | 0 | Noneday or Sansday |
| Monday | 1 | Oneday |
| Tuesday | 2 | Twosday |
| Wednesday | 3 | Treblesday |
| Thursday | 4 | Foursday |
| Friday | 5 | Fiveday |
| Saturday | 6 | Six-a-day |
There are some languages, such as Slavic languages, Chinese, Estonian, Greek, Portuguese, Galician and Hebrew, that base some of the names of the week days in their positional order. The Slavic, Chinese, and Estonian agree with the table above; the other languages mentioned count from Sunday as day one.