Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes calcuate days in a calender.era or between two days Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "calcuate days in a calender.era or between two days" Watch "calcuate days in a calender.era or between two days" New topic
Author

calcuate days in a calender.era or between two days

aminur rashid
Ranch Hand

Joined: Sep 21, 2001
Posts: 79
Hi,
I have two Date Instance
Date startDate and Date endDate.
Now user will be specifying some step size to go from startDate to endDate in a JSpinner.
Now i have to validate that the step size should be less than the number of days between startDate and endDate.
e.g
startDate is 05/01/2000 // in dd//MM/yyyy format
and endDate is 05/02/2000 //in same format
Now i should stop user from selecting step size as Calendar.Era,Calendar.Year but should allow him to select lower values.
Any idea how to proceed??


Regards<br />Aminur
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Here is a topic that discusses how to find the difference in two dates:
http://www.coderanch.com/t/282529/JSP/java/Subtracting-Time-Date-JSP


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
Consider Paul's rocket mass heater.
 
subject: calcuate days in a calender.era or between two days