Here you can find the source of getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds)
public static String getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds)
//package com.java2s; /**//from ww w . j a v a 2s. c o m * License: https://github.com/votingsystem/votingsystem/wiki/Licencia */ public class Main { /** * elapsed time in hours/minutes/seconds * @return String */ public static String getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds) { String format = String.format("%%0%dd", 2); long elapsedTime = milliseconds / 1000; String seconds = String.format(format, elapsedTime % 60); String minutes = String.format(format, (elapsedTime % 3600) / 60); String hours = String.format(format, elapsedTime / 3600); String time = hours + ":" + minutes + ":" + seconds; return time; } }