• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hwo to get set of Dates between two limits ?

 
Muralidhar Gandepalli
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requirment :
If user Enters(mm/dd/yy) 01/01/03 and 01/05/03 i
need to get the following set as OutPut =
{01/01/03,01/02/03,01/03/03,01/04/03,01/05/03}
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);
objXDate.next()----> 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
Murali
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sunita shaw
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....

k
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic