hi friends
I am using AIX 5.2 version
when ever i try to use
echo $(date -d yesterday +"%Y%m%d")
I am getting error as
date: not recognized flag d
please help me solve this.
I wanted to find the next date from a given date.
I tried using diff script but all of them failed at some point or another please help.
if you wanna find next date in AIX you have to change your TZ variable
fnsonlu1-/home/fnsonlu1/vidya_perl> date
Sun Nov 16 12:02:44 IST 2008
fnsonlu1-/home/fnsonlu1/vidya_perl> echo $TZ
IST-5:30
fnsonlu1-/home/fnsonlu1/vidya_perl> TZ=IST+24
fnsonlu1-/home/fnsonlu1/vidya_perl> date
Sat Nov 15 06:32:58 IST 2008
fnsonlu1-/home/fnsonlu1/vidya_perl> TZ=IST-24
fnsonlu1-/home/fnsonlu1/vidya_perl> date
Mon Nov 17 06:33:07 IST 2008
fnsonlu1-/home/fnsonlu1/vidya_perl> TZ=IST-5:30
fnsonlu1-/home/fnsonlu1/vidya_perl> date
Sun Nov 16 12:03:15 IST 2008
You could use the 'date' command from the 'coreutils' package from the AIX toolbox area on IBM's site. (see the AIX links page at the top of the forum). You will need to install RPM aswell.
Then you'll have a date command (/usr/local/bin/date) that will accept the -d parameter. Can be very handy some times!