A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Linux / UNIX
Adding days to a date
Joined: Aug 31, 2008
May 15, 2012 01:07:10
My requirement is to add no.of days to date as shown below. The date will be in
So please let me know how to convert the string to date and after conversion how to add no.of days to the date.
Please help to solve this issue.
Thanks & Regards
Joined: Sep 21, 2011
May 15, 2012 01:49:29
And you want to do this in a Unix shell script?
Joined: Jun 25, 2001
May 15, 2012 05:10:55
No problem. Here's a little snippet I use to get the start (STIME) and end date (ETIME) of a month:
STIME=`date +%s --date="$MM 1 "` ETIME=`date +%s --date="$MM 1 + 1 month - 1 day"`
"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.
subject: Adding days to a date
Reg : How to get the No.of Active ConnectionPools?
get the date of next Monday
getting system date
add day to current date
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015