Yesterday’s Date using Shell Script Commands

This page answers questions like these:


Related Links:
Tomorrow's Date using Shell Script Commands
What Day of the Week Was It?
Is this Year a Leap Year? (using Shell Script Commands)



How to get Yesterday’s Date using a Shell Script Command?

date -d yesterday "+%Y-%m-%d"

How to get the Time One Hour Ago using a Shell Script Command?

date -d "-1 hour" "+%H:%M:%S"



Related Links:
Tomorrow's Date using Shell Script Commands
What Day of the Week Was It?
Is this Year a Leap Year? (using Shell Script Commands)

Home  >  Linux / Unix  >  Yesterday’s Date using Shell Script Commands


Tags: yesterday shell script, yesterday bash, yesterday linux, yesterday unix, shell date yesterday, linux date yesterday, date, yesterday’s date, shell script, shell command, linux, unix, solaris, bsd, aix

Copyright © HelpDoco.com
date-yesterday.txt
Linux-Unix/yesterdays-date-using-shell-script-commands.htm
2