• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hwo to get set of Dates between two limits ?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic