How to get the previous day's date & time in AIX unix

May 2, 2012 at 00:50:38
Specs: Windows XP
How to get the previous day's date & time in AIX unix. pliz help ASAP. have tried with " date --date " bt nt working.

See More: How to get the previous days date & time in AIX unix

Report •

#1
May 2, 2012 at 11:03:13
The AIX date command does not support GNU extensions. The easiest was of doing what you want is a perl program. Here is a trick I learned from FishMonger: since there are 86,400 seconds in a day, subtract that from the time argument - a function of perl's localtime function:

perl -MPOSIX -e 'print strftime("%m-%d-%Y %H:%M:%S",localtime(time-86400*1))'


Report •
Related Solutions


Ask Question