Java Minute Get getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds)

Here you can find the source of getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds)

Description

elapsed time in hours/minutes/seconds

License

Open Source License

Return

String

Declaration

public static String getElapsedTimeHoursMinutesFromMilliseconds(long milliseconds) 

Method Source Code

//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;
    }
}

Related

  1. currentTimeMinutes()
  2. fromMinutes(long seed)
  3. getCompleteDayAsHourMinuteString()
  4. getFiveMinuteCronByHostId(long hostId)
  5. getFrequencyValueInMinutes(long value)
  6. getHMTimeInMinutes(final String timeStr)
  7. getHourMinuteSecond(long misSecond)