I am unable to get the last week date i tried to use the following commands but i failed
Please help, and am using HP unix
date -d "+1 week"
date --date=yesterday +%y%m%d
I am unable to get the last week date i tried to use the following commands but i failed
Please help, and am using HP unix
date -d "+1 week"
date --date=yesterday +%y%m%d
-d only supports in GNU date
http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
I did not got the solution from the above link, please help i need the last week's date and yesterdays date.....
$ perl -e 'print localtime(time() - 86400) . "\n" '
Tue Jul 31 08:32:31 2012
$ perl -e 'print localtime(time() - 7*86400) . "\n" '
Wed Jul 25 08:32:39 2012
http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
How to get the date in dd/mm/yyyy format using the above command
Try:
$ perl -e 'use POSIX strftime; print POSIX::strftime("%d/%m/%Y\n", localtime(time()-7*86400))'
26/07/2012