In two days time
12 October 2005

One of the joys of Linux is the voyage of discovery. Not just in Linux itself, but the GNU tools that support it. Today, for example, I was working on a short TV reminder script and needed to know the day. Well, that's easy: use date +%A.

I then needed to the day in two days time. I started thinking about using expr, or a Perl script, or something else even more unwieldy. I then discovered (thanks, once more, to Google) this site, which informed me about:


date -d "1 day ago"


Truly brilliant. Now, it's only the GNU tools that do this, but what a great extension. To get my answer of "in 2 days time" it was simply a case of thinking backwards to know that:

date -d "5 day ago"

was equivalent. Although further probing caused me to note:

date -d "2 tomorrow"

This is my prefered solution since I can also retrieve the correct date too, should I need it.