| Author |
Adding days to Calendar
|
Arjunkumar Shastry
Ranch Hand
Joined: Feb 28, 2005
Posts: 986
|
|
|
GregorianCalendar allows to add X amount of days/minutes etc.But those changes are only for that Calendar.I need new instance of GregorianCalendar which will be X days ahead of another GregorianCalandar.add() method does not retutn new GregorianCalendar.
|
Namma Suvarna Karnataka
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12928
|
|
Create a new instance of GregorianCalendar and set the date and time of the new instance to the same as the old one (lookup the API documentation for the methods you need). Then add the number of days to the new one by using the add() method. [ June 09, 2006: Message edited by: Jesper Young ]
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Adding days to Calendar
|
|
|