aspose file tools*
The moose likes Beginning Java and the fly likes Any java class to hold time duration ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Any java class to hold time duration ?" Watch "Any java class to hold time duration ?" New topic
Author

Any java class to hold time duration ?

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Greetings,
I would like to store time duration as in hh:mm:ss
and be able to find out the difference between two
times. Which java class should I be using ?
Thanks
Pho


Regards,

Pho
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
Would it be simpler to find the differences in the time as milliseconds and subtract the milliseconds before converting to hh:mm:ss?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Yes I could possibly store it as a millisec. Although a
conversion will be needed as I get my inputs as a
string "hh:mm:ss". So is there a class that can take
a millisec and provide methods to retrieve it in the format
mentioned?
Pho
[This message has been edited by Pho Tek (edited October 09, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Any java class to hold time duration ?
 
Similar Threads
Speed of Accessing ArrayList and LinkedList
Simple JMF question - help needed urgently!
New beta test CX-311-085: Sun Certified JSP and Servlet Developer for the JEE 6 Platform
Easy stringbuffer questions
Sieve of Eratosthenes