I want to convert the second/milliseconds in this format \"HH:mm:ss\" (for esamples, from 5 seconds to 00:00:05). I tried to get that format in this way:
int mil
Java 9 answer:
Duration dur = Duration.ofMillis(millis); System.out.println(String.format("%02d:%02d:%02d", dur.toHours(), dur.toMinutesPart(), dur.toSecondsPart()));
(not tested yet)
The toXxPart methods are described in the API docs for Java 9.
toXxPart