dcsimg
How can I calculate difference between two dates?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gleidisdon_Duarte
Posted On:   Tuesday, June 5, 2001 06:02 AM

How can I calculate difference between two dates? I need to get days, months and years. If possible I'd like to get result in hours too.

Re: How can I calculate difference between two dates?

Posted By:   John_Mitchell  
Posted On:   Sunday, June 17, 2001 03:50 PM

Re: How can I calculate difference between two dates?

Posted By:   Christopher_Schultz  
Posted On:   Tuesday, June 5, 2001 06:32 AM

Convert both dates to long values (via getTime()), subtract them, and convert that into a Date.



Then, ask that Date for it's year, month, date, hour, minute, second, and millisecond.



-chris
About | Sitemap | Contact