Alex Rivera | Logout

Java convert an int into hours and minutes

Asked 2012-11-30T23:59:56.577
8

I have two ints 1530 and 830 which is supposed to represent 15:30 and 8:30 in time. What is the best way to convert this number into milliseconds? I was thinking of converting them into strings and sub strings but this seems like a very inefficient approach.

Edit
Report

1 Answer

2
( x / 100 ) * 3600000L + (x % 100) * 60000L
answered 2012-12-01T00:02:41.460

Your Answer