Skip to content

Instantly share code, notes, and snippets.

@pille1842
Created October 3, 2018 19:42
Show Gist options
  • Select an option

  • Save pille1842/f4f147d769cf71dcf09d7a164cede787 to your computer and use it in GitHub Desktop.

Select an option

Save pille1842/f4f147d769cf71dcf09d7a164cede787 to your computer and use it in GitHub Desktop.
Every Easter Sunday from 1700-2299
1700-04-11
1701-03-27
1702-04-16
1703-04-08
1704-03-23
1705-04-12
1706-04-04
1707-04-24
1708-04-08
1709-03-31
1710-04-20
1711-04-05
1712-03-27
1713-04-16
1714-04-01
1715-04-21
1716-04-12
1717-03-28
1718-04-17
1719-04-09
1720-03-31
1721-04-13
1722-04-05
1723-03-28
1724-04-16
1725-04-01
1726-04-21
1727-04-13
1728-03-28
1729-04-17
1730-04-09
1731-03-25
1732-04-13
1733-04-05
1734-04-25
1735-04-10
1736-04-01
1737-04-21
1738-04-06
1739-03-29
1740-04-17
1741-04-02
1742-03-25
1743-04-14
1744-04-05
1745-04-18
1746-04-10
1747-04-02
1748-04-14
1749-04-06
1750-03-29
1751-04-11
1752-04-02
1753-04-22
1754-04-14
1755-03-30
1756-04-18
1757-04-10
1758-03-26
1759-04-15
1760-04-06
1761-03-22
1762-04-11
1763-04-03
1764-04-22
1765-04-07
1766-03-30
1767-04-19
1768-04-03
1769-03-26
1770-04-15
1771-03-31
1772-04-19
1773-04-11
1774-04-03
1775-04-16
1776-04-07
1777-03-30
1778-04-19
1779-04-04
1780-03-26
1781-04-15
1782-03-31
1783-04-20
1784-04-11
1785-03-27
1786-04-16
1787-04-08
1788-03-23
1789-04-12
1790-04-04
1791-04-24
1792-04-08
1793-03-31
1794-04-20
1795-04-05
1796-03-27
1797-04-16
1798-04-08
1799-03-24
1800-04-13
1801-04-05
1802-04-18
1803-04-10
1804-04-01
1805-04-14
1806-04-06
1807-03-29
1808-04-17
1809-04-02
1810-04-22
1811-04-14
1812-03-29
1813-04-18
1814-04-10
1815-03-26
1816-04-14
1817-04-06
1818-03-22
1819-04-11
1820-04-02
1821-04-22
1822-04-07
1823-03-30
1824-04-18
1825-04-03
1826-03-26
1827-04-15
1828-04-06
1829-04-19
1830-04-11
1831-04-03
1832-04-22
1833-04-07
1834-03-30
1835-04-19
1836-04-03
1837-03-26
1838-04-15
1839-03-31
1840-04-19
1841-04-11
1842-03-27
1843-04-16
1844-04-07
1845-03-23
1846-04-12
1847-04-04
1848-04-23
1849-04-08
1850-03-31
1851-04-20
1852-04-11
1853-03-27
1854-04-16
1855-04-08
1856-03-23
1857-04-12
1858-04-04
1859-04-24
1860-04-08
1861-03-31
1862-04-20
1863-04-05
1864-03-27
1865-04-16
1866-04-01
1867-04-21
1868-04-12
1869-03-28
1870-04-17
1871-04-09
1872-03-31
1873-04-13
1874-04-05
1875-03-28
1876-04-16
1877-04-01
1878-04-21
1879-04-13
1880-03-28
1881-04-17
1882-04-09
1883-03-25
1884-04-13
1885-04-05
1886-04-25
1887-04-10
1888-04-01
1889-04-21
1890-04-06
1891-03-29
1892-04-17
1893-04-02
1894-03-25
1895-04-14
1896-04-05
1897-04-18
1898-04-10
1899-04-02
1900-04-15
1901-04-07
1902-03-30
1903-04-12
1904-04-03
1905-04-23
1906-04-15
1907-03-31
1908-04-19
1909-04-11
1910-03-27
1911-04-16
1912-04-07
1913-03-23
1914-04-12
1915-04-04
1916-04-23
1917-04-08
1918-03-31
1919-04-20
1920-04-04
1921-03-27
1922-04-16
1923-04-01
1924-04-20
1925-04-12
1926-04-04
1927-04-17
1928-04-08
1929-03-31
1930-04-20
1931-04-05
1932-03-27
1933-04-16
1934-04-01
1935-04-21
1936-04-12
1937-03-28
1938-04-17
1939-04-09
1940-03-24
1941-04-13
1942-04-05
1943-04-25
1944-04-09
1945-04-01
1946-04-21
1947-04-06
1948-03-28
1949-04-17
1950-04-09
1951-03-25
1952-04-13
1953-04-05
1954-04-18
1955-04-10
1956-04-01
1957-04-21
1958-04-06
1959-03-29
1960-04-17
1961-04-02
1962-04-22
1963-04-14
1964-03-29
1965-04-18
1966-04-10
1967-03-26
1968-04-14
1969-04-06
1970-03-29
1971-04-11
1972-04-02
1973-04-22
1974-04-14
1975-03-30
1976-04-18
1977-04-10
1978-03-26
1979-04-15
1980-04-06
1981-04-19
1982-04-11
1983-04-03
1984-04-22
1985-04-07
1986-03-30
1987-04-19
1988-04-03
1989-03-26
1990-04-15
1991-03-31
1992-04-19
1993-04-11
1994-04-03
1995-04-16
1996-04-07
1997-03-30
1998-04-12
1999-04-04
2000-04-23
2001-04-15
2002-03-31
2003-04-20
2004-04-11
2005-03-27
2006-04-16
2007-04-08
2008-03-23
2009-04-12
2010-04-04
2011-04-24
2012-04-08
2013-03-31
2014-04-20
2015-04-05
2016-03-27
2017-04-16
2018-04-01
2019-04-21
2020-04-12
2021-04-04
2022-04-17
2023-04-09
2024-03-31
2025-04-20
2026-04-05
2027-03-28
2028-04-16
2029-04-01
2030-04-21
2031-04-13
2032-03-28
2033-04-17
2034-04-09
2035-03-25
2036-04-13
2037-04-05
2038-04-25
2039-04-10
2040-04-01
2041-04-21
2042-04-06
2043-03-29
2044-04-17
2045-04-09
2046-03-25
2047-04-14
2048-04-05
2049-04-18
2050-04-10
2051-04-02
2052-04-21
2053-04-06
2054-03-29
2055-04-18
2056-04-02
2057-04-22
2058-04-14
2059-03-30
2060-04-18
2061-04-10
2062-03-26
2063-04-15
2064-04-06
2065-03-29
2066-04-11
2067-04-03
2068-04-22
2069-04-14
2070-03-30
2071-04-19
2072-04-10
2073-03-26
2074-04-15
2075-04-07
2076-04-19
2077-04-11
2078-04-03
2079-04-23
2080-04-07
2081-03-30
2082-04-19
2083-04-04
2084-03-26
2085-04-15
2086-03-31
2087-04-20
2088-04-11
2089-04-03
2090-04-16
2091-04-08
2092-03-30
2093-04-12
2094-04-04
2095-04-24
2096-04-15
2097-03-31
2098-04-20
2099-04-12
2100-03-28
2101-04-17
2102-04-09
2103-03-25
2104-04-13
2105-04-05
2106-04-18
2107-04-10
2108-04-01
2109-04-21
2110-04-06
2111-03-29
2112-04-17
2113-04-02
2114-04-22
2115-04-14
2116-03-29
2117-04-18
2118-04-10
2119-03-26
2120-04-14
2121-04-06
2122-03-29
2123-04-11
2124-04-02
2125-04-22
2126-04-14
2127-03-30
2128-04-18
2129-04-10
2130-03-26
2131-04-15
2132-04-06
2133-04-19
2134-04-11
2135-04-03
2136-04-22
2137-04-07
2138-03-30
2139-04-19
2140-04-03
2141-03-26
2142-04-15
2143-03-31
2144-04-19
2145-04-11
2146-04-03
2147-04-16
2148-04-07
2149-03-30
2150-04-12
2151-04-04
2152-04-23
2153-04-15
2154-03-31
2155-04-20
2156-04-11
2157-03-27
2158-04-16
2159-04-08
2160-03-23
2161-04-12
2162-04-04
2163-04-24
2164-04-08
2165-03-31
2166-04-20
2167-04-05
2168-03-27
2169-04-16
2170-04-01
2171-04-21
2172-04-12
2173-04-04
2174-04-17
2175-04-09
2176-03-31
2177-04-20
2178-04-05
2179-03-28
2180-04-16
2181-04-01
2182-04-21
2183-04-13
2184-03-28
2185-04-17
2186-04-09
2187-03-25
2188-04-13
2189-04-05
2190-04-25
2191-04-10
2192-04-01
2193-04-21
2194-04-06
2195-03-29
2196-04-17
2197-04-09
2198-03-25
2199-04-14
2200-04-06
2201-04-19
2202-04-11
2203-04-03
2204-04-22
2205-04-07
2206-03-30
2207-04-19
2208-04-03
2209-03-26
2210-04-15
2211-03-31
2212-04-19
2213-04-11
2214-03-27
2215-04-16
2216-04-07
2217-03-30
2218-04-12
2219-04-04
2220-04-23
2221-04-15
2222-03-31
2223-04-20
2224-04-11
2225-03-27
2226-04-16
2227-04-08
2228-03-23
2229-04-12
2230-04-04
2231-04-24
2232-04-08
2233-03-31
2234-04-20
2235-04-05
2236-03-27
2237-04-16
2238-04-01
2239-04-21
2240-04-12
2241-04-04
2242-04-17
2243-04-09
2244-03-31
2245-04-13
2246-04-05
2247-03-28
2248-04-16
2249-04-01
2250-04-21
2251-04-13
2252-03-28
2253-04-17
2254-04-09
2255-03-25
2256-04-13
2257-04-05
2258-04-25
2259-04-10
2260-04-01
2261-04-21
2262-04-06
2263-03-29
2264-04-17
2265-04-02
2266-03-25
2267-04-14
2268-04-05
2269-04-18
2270-04-10
2271-04-02
2272-04-21
2273-04-06
2274-03-29
2275-04-18
2276-04-02
2277-04-22
2278-04-14
2279-03-30
2280-04-18
2281-04-10
2282-03-26
2283-04-15
2284-04-06
2285-03-22
2286-04-11
2287-04-03
2288-04-22
2289-04-07
2290-03-30
2291-04-19
2292-04-10
2293-03-26
2294-04-15
2295-04-07
2296-04-19
2297-04-11
2298-04-03
2299-04-16

How was this file produced?

I took the dates from this site and saved them to a file. After cleaning it up in Emacs, it consisted of a list of dates, one date per line, in natural language (e.g. "1st April 2018", "12th April 2020"). I named the file eastersunday.in.

I installed parsedatetime with pip:

$ sudo -H pip3 install parsedatetime

Then I wrote this little script:

#!/usr/bin/env python3
import parsedatetime as pdt

cal = pdt.Calendar()
with open("eastersunday.in", "r") as f:
    for datum in f:
        print("{}".format(cal.parseDT(datum)[0]))

I ran it, sorted the output and put it in a file called eastersunday.txt:

$ ./parse.py | sort >eastersunday.txt

Again in Emacs, I ran a keyboard macro to remove the time bit from each line and ended up with the above list.

What is it good for?

I needed this for a recent project where I wanted to calculate Easter Monday, Pentecost Monday etc. for a lot of years. These dates are all based on the date of Easter Sunday. To print the date of Pentecost Monday for each of the listed years, for example, one could use the following little Bash script:

#!/bin/bash

while read datum; do
    date -d "$datum+50 days" +%Y-%m-%d
done <eastersunday.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment