File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Hwo to get set of Dates between two limits ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hwo to get set of Dates between two limits ?" Watch "Hwo to get set of Dates between two limits ?" New topic

Hwo to get set of Dates between two limits ?

Muralidhar Gandepalli

Joined: Apr 13, 2001
Posts: 13
Requirment :
If user Enters(mm/dd/yy) 01/01/03 and 01/05/03 i
need to get the following set as OutPut =
In order to achive above functionality ,Is there any Class in Java which has a function next() which returns me the next date ?
i.e XDate objXDate= new XDate(01/01/03);> give me 01/02/03 .
If there is any class like this please let me know .That would be great help to me !!
thanx in advance
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Look at the java.util.Calendar methods. These should work for you.

Of course, this code depends on whether you want a list of Date objects, how you want to handle startDate coming after endDate (users aren't always going to oblige), etc.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
sunita shaw
Ranch Hand

Joined: Apr 06, 2003
Posts: 45
thanx joel , u've got it exactally what i want but can u please write a small java/jsp program for this problem, i dunno where i'm making the mistake,cant send u my code coz its too long,so just send me as soon as possible.
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
how about you try yourself first and then tell us where the problems are instead of asking people to do your work ASAP....
it's early in the morning...too early for me....

I agree. Here's the link:
subject: Hwo to get set of Dates between two limits ?
jQuery in Action, 3rd edition