File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert hh:mm:ss in millisecond" Watch "Convert hh:mm:ss in millisecond" New topic

Convert hh:mm:ss in millisecond

Moni Patil

Joined: Feb 03, 2005
Posts: 9
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.
I agree. Here's the link:
subject: Convert hh:mm:ss in millisecond
It's not a secret anymore!