APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

How can I find out when our anniversary falls on a Saturday?

Got questions? Go ahead: Ask me anything!

Anonymous asks:

How can I find out when our anniversary falls on a Saturday? I thought it would be easy, but it doesn't seem to be?

Actually, Google can help with this. For example, just type in your browser window "what day is 7/11/2020":

Google knows what day it is

In Linux/Unix Bash, there's a quick command line that will find these dates:

$ for i in {2016..2050}; do echo -n "$i ";cal 07 $i | grep 11; done| grep "10 11$"
2020  5  6  7  8  9 10 11
2026  5  6  7  8  9 10 11
2037  5  6  7  8  9 10 11
2043  5  6  7  8  9 10 11
2048  5  6  7  8  9 10 11
 

Note that can look backward just as easily:

$ for i in {2016..1960}; do echo -n "$i ";cal 07 $i | grep 11; done| grep "10 11$"
2015  5  6  7  8  9 10 11
2009  5  6  7  8  9 10 11
1998  5  6  7  8  9 10 11
1992  5  6  7  8  9 10 11
1987  5  6  7  8  9 10 11
1981  5  6  7  8  9 10 11
1970  5  6  7  8  9 10 11
1964  5  6  7  8  9 10 11
 

Somewhere there may be an online calculator for this. I couldn't find one, but I did find these:

Weekday Calculator – What Day is this Date?

Doomsday Rule

Is there a term for an anniversary that falls on the same day of the week as its original date?

Holidays

Calculating holidays and their observances

Calculate next workday when date falls on weekend

Calculating Holidays in script



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> How can I find out when our anniversary falls on a Saturday?




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Doing linear scans over an associative array is like trying to club someone to death with a loaded Uzi. (Larry Wall)

By understanding a machine-oriented language, the programmer will tend to use a much more efficient method; it is much closer to reality. (Donald Knuth)







This post tagged: