Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert hh:mm:ss in millisecond

 
Moni Patil
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic