Java Minute minutesFromSecondPadded(int seconds)

Here you can find the source of minutesFromSecondPadded(int seconds)

Description

Returns the minutes:secods of a given time interval

License

Apache License

Parameter

Parameter Description
seconds the seconds to convert

Return

the minutes:seconds representation of the interval (numbers are padded with zeros to 00:00)

Declaration

public static String minutesFromSecondPadded(int seconds) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static final int SECONDS_PER_MINUTE = 60;

    /**//from  ww  w .j  a va  2s.c om
     * Returns the minutes:secods of a given time interval
     *
     * @param seconds
     *            the seconds to convert
     * @return the minutes:seconds representation of the interval (numbers are padded with zeros to 00:00)
     */
    public static String minutesFromSecondPadded(int seconds) {
        return String.format("%02d:%02d", seconds / SECONDS_PER_MINUTE, seconds % SECONDS_PER_MINUTE);
    }
}

Related

  1. minutes(int num)
  2. minutes(int seconds)
  3. minutes2Ms(long minutes)
  4. minutes2seconds(long minutes)
  5. minutesFromEpisode(int episodeNumber, int episodeLength)
  6. minutesFromSlots(int slots)
  7. mjdInMinutes(double mjd)
  8. nextMinutes(int diff)
  9. normalizeToMinute(Date date)