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.
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