Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting previous date. 2

Status
Not open for further replies.

cleansedbb

Technical User
Feb 11, 2002
95
US
this isnt a major problem because I can just change the
time of process but I have a cron that changes a log
file to the date, thing is I didnt think and then
made a ftp program to send it the next day. well the
next day TODAYSDATE.log doesnt exist.

how do I get yesterdays date?

the way I'm getting date now is

DATE = `date +%m%d%Y`

is there a way to %d -1 = yesterdays date?

Thanks

CBB
 
To get yesterdays date, I use

> $ TZ=GMT+24 date

Ihope this is what you want.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top