Yesterday’s Date using Shell Script Commands

This page answers questions like these:

How do I Get Yesterday’s Date using a Shell Script Command?

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

How do I 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: date, yesterday’s date, shell script, shell command, linux, unix

Src: date-yesterday.txt
Dst: Linux-Unix/yesterdays-date-using-shell-script-commands.htm
Ads: 3