aspose file tools*
The moose likes Beginning Java and the fly likes Dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Dates" Watch "Dates" New topic
Author

Dates

Giomar Guevara
Ranch Hand

Joined: Oct 18, 2006
Posts: 51
I want to get the difference between 2 dates and get it in hours....

How can I do that?
David Buzatto
Greenhorn

Joined: Jul 16, 2006
Posts: 9
Take a look in the Joda Time API.

Bye!


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Fowler)
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Take a look at these JavaWorld articles: Calculating Java dates and Working in Java time : Learn the basics of calculating elapsed time in Java - they do a nice job of explaining Date math in Java.
 
Don't get me started about those stupid light bulbs.
 
subject: Dates