Dates for Major US Holidays, 1900-2400
Recently a project at work required me have the dates for major holidays between 1990 and 2020. I couldn't find all the dates I needed in one place... so I decided to generate them and put them all in one place, in case I (or anyone else) ever needs them again.
Now, I realize many of these holidays didn't exist in 1900, and 2400 is pretty far away, so just take the years that you need.
See something wrong?
Let me know.
| Rule: |
The 25th of each December |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-12-25"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
Calculated from the lunar cycle |
| Code: |
for ((i=1900;i<=2400;i++)) do date -d "`ncal -e $i | sed -e 's/[0-9]\{4\}/2000/'`" +%Y-%m-%d | sed -e "s/2000/$i/"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
Third Sunday of June |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-06-`cal 6 $i | cut -b 1-2 | grep '[0-9]' | head -3 | tail -1`"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
The 4th of each July |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-07-04"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
First Monday in September |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-09-`cal 9 $i | cut -b 4-5 | grep '[0-9]' | sed -e "s/ /0/" | head -1`"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
Last Monday in May |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-05-`cal 5 $i | cut -b 4-5 | grep '[0-9]' | tail -1`"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
The 30th of each May |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-05-30"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
Second Sunday of May |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-05-`cal 5 $i | cut -b 1-2 | grep '[0-9]' | sed -e "s/ /0/" | head -2 | tail -1`"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
The first day of the year |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-01-01"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
Fourth Thursday in November |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-11-`cal 11 $i | sed '1d' | cut -b 13-14 | grep '[0-9]' | head -4 | tail -1`"; done; |
| Wikipedia: |
link |
| Download: |
here |
| Rule: |
The 14th of each February |
| Code: |
for ((i=1900;i<=2400;i++)) do echo "$i-02-14"; done; |
| Wikipedia: |
link |
| Download: |
here |