CONVERT THE GIVEN TIME INTO MILLISECONDS USING JAVA

E E Cummings

Total Post:26

Points:182
Posted by  E E Cummings
Java 
 1414  View(s)
Ratings:
Rate this:

I am trying to convert the time (hh:mm:ss) into milliseconds. How could i do it?

Is it right to use the following one?

hh * mm * ss * 1000;

But if the minute is 00 or second is 00, it gives 0.

How do I calculate this?

  1. Dag Hammarskjold

    Post:24

    Points:168
    Re: Convert the given time into milliseconds using Java

    You Should use this code: - (hh * 3600 + mm * 60 + ss) * 1000;

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!