• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding days to a date

 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you want to do this in a Unix shell script?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic