DEV Community

skptricks
skptricks

Posted on

Convert Milliseconds into Days, Hours, Minutes, Seconds in Java

Post Link : Convert Milliseconds into Days, Hours, Minutes, Seconds in Java

Sometimes we need to convert the milliseconds into days or hours or minutes or seconds, so in this post we will see how to convert milliseconds into days, hours, minutes, seconds in Java.

Basically when you want to check the exact time taken to execute a program then you may need to calculate the time. So in this case you get the start time in milliseconds and end time in milliseconds and you want to check how much time that program took to execute. Therefore you would like to convert the milliseconds into minutes and seconds to make it more readable format because millisecond unit may not be so understandable quickly.

Read More...

Top comments (0)