Possible Duplicate:
Calculating the Difference Between Two Java Date Instances
hi, I have two object of type java.util.date.
Date StartDate;
Date EndDate;
Both object have a date and specified time. I need to find the interval between them in hours, minutes and seconds. I can do it in someways but i was thinking that my technique is not the best.
So what tech would u have used for this operation in Java
JodaTime can handle this stuff for you. See, in particular, Interval and Period.
The above will print: 0 years, 0 months, 1 weeks, 0 days