cancel
Showing results for 
Search instead for 
Did you mean: 

dates

 
SOLVED
Go to solution
Manuales
Super Advisor

dates

How can i get the "date" 5 days ago?
if today is Friday Nov 3 and i need to know day of 5 days ago?

can i do operations among dates?

nov 3 - (5 days) = october 30

how can i do that, please let me know
4 REPLIES
Michael Steele_2
Honored Contributor
Solution

Re: dates

Refer to A. Clay Stevenson's script 'Date Hammer' which is found at the bottom of this link:

http://mirrors.develooper.com/hpux/
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: dates

Hi Manuales:

Use Perl;

# perl -MPOSIX -le '$ago=shift||0;print strftime "%d-%b-%y",localtime(time-(60*60*24*$ago))' 5

23-Oct-09

You can use the same formatting directives to the strftime() function that you would use with the 'date' command.

Regards!

...JRF...
Arturo Galbiati
Esteemed Contributor

Re: dates

Hello,
caldj.sh -p5 -I -D

HTH,
Art