How to do Date Manupulation in Korn Shell?

Hi All,

I need to find the date 19days back from the current date:
eg: if today is 17 March 2013
then the output should be : 26 Feb 2013

Can i do this using date command in Korn Shell?

And also if i need future 15 days date from current date, how to that?

Any help appreciated :slight_smile:

Thanks in advance

With GNU date:

date -d"-19 days" +"%d-%b-%Y"
date -d"+15 days" +"%d-%b-%Y"

Thanks for the reply but after executing the above script i got following error:

date: illegal option -- d
Usage: date [-u] [+format]
       date [-u] [mmddhhmm[[cc]yy]]
       date [-a [-]sss.fff]

It's korn shell UNIX AIX. Any other suggestions?

Have a look at this thread