jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes Convert hh:mm:ss in millisecond Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert hh:mm:ss in millisecond" Watch "Convert hh:mm:ss in millisecond" New topic
Author

Convert hh:mm:ss in millisecond

Moni Patil
Greenhorn

Joined: Feb 03, 2005
Posts: 9
Hi,
I want to convert the time ( which is available in the format hh:mm:ss ) into milliseconds. Suggest the code for the same.
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
You want java.text.DateFormat . Create an appropriate instance of DateFormat. Use the parse() method to get a Date [some people prefer to go to bars]. Use getTime() on the Date object to get milliseconds.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
Don't get me started about those stupid light bulbs.
 
subject: Convert hh:mm:ss in millisecond
 
Similar Threads
Convert milliseconds to time
How to convert hours,minutes,seconds to seconds
date format conversion to MM/dd/yyyy hh:mm a
Subtract two timeperiods
Converting MySQL Datetime to MS SQL Datetime and vice versa !