0

Hi all,

I want to create a function that adds certain amount of days for a given date.

e.g.

Say today's date is 21/9/2007. and I would like to add 95 days to this date. How do I accomplish that.

Any help will be real appreciate it.

Regards.

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Ezzaral
0

You will want to use Calendar (or perhaps specifically GregorianCalendar) class for that. This site has a lot of info on using it: http://mindprod.com/jgloss/calendar.html
Adding time (days, weeks, months, whatever) is a simple matter of using the add() method or the roll() method depending on your needs. Calendar now = Calendar.getInstance(); will give you a locale-specific instance of a Calendar set to the current date and time.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.