Hello All,
I am writing a script in Sun Solaris
I want the date for "day before yesterday", i got the yesterday's date by this command
TZ=GMT+24 date +%b" "%d
.
Please suggest me some code to get the date for day before yesterday
Hello All,
I am writing a script in Sun Solaris
I want the date for "day before yesterday", i got the yesterday's date by this command
TZ=GMT+24 date +%b" "%d
.
Please suggest me some code to get the date for day before yesterday
$ DAY_BEFORE_YEST=`TZ="GMT+48" date +'%m/%d/%Y'`
$ echo $DAY_BEFORE_YEST
12/18/2012
perl -le 'print scalar localtime (time() - 48*60*60);' |awk '{print $2 ,$3}'
Thank You ningy and itkamaraj, It worked
i just use Date command.
date +%Y%m%d -d '2 days ago'
you could even use your text
date +%Y%m%d -d 'day before yesterday'
(i just asked a question similar in the last week )
And in your question "in the last week" you were using CentOS, not Solaris
Useful information:
Perderabo's day/date arithmetic functions
And this was run on Solaris 10. I have Solaris 9 & 10, redhat and centos system (i don't do windows).
The 2 days ago option worked on each, though i do admit the day before yesterday wasn't liked on the all the systems so i should have left it out.