wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes Adding days to a date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Adding days to a date" Watch "Adding days to a date" New topic
Author

Adding days to a date

aresh babu
Ranch Hand

Joined: Aug 31, 2008
Posts: 65
Hi All,

My requirement is to add no.of days to date as shown below. The date will be in string format.

So please let me know how to convert the string to date and after conversion how to add no.of days to the date.

For Eg:

rechstring="20120515"
adddays=5
output:20120520

Please help to solve this issue.

Thanks & Regards
Aresh
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
And you want to do this in a Unix shell script?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

No problem. Here's a little snippet I use to get the start (STIME) and end date (ETIME) of a month:

"MM" is the name of a month in the current year.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding days to a date