wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Convert hh:mm:ss in millisecond
Similar Threads
How to convert hours,minutes,seconds to seconds
date format conversion to MM/dd/yyyy hh:mm a
Convert milliseconds to time
Subtract two timeperiods
Converting MySQL Datetime to MS SQL Datetime and vice versa !