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 Building Microservices this week in the Design 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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Convert hh:mm:ss in millisecond
 
It's not a secret anymore!