Java Minute Format formatMinutes(int minutes)

Here you can find the source of formatMinutes(int minutes)

Description

Converts minutes to hours and minutes separated by colon, i.e.

License

Open Source License

Parameter

Parameter Description
minutes a parameter

Return

hours and minutes separated by colon, i.e. H:MM

Declaration

public static String formatMinutes(int minutes) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    /**/*www.java2 s. co  m*/
     * Converts minutes to hours and minutes separated by colon, i.e. H:MM
     * 
     * @param minutes
     * @return hours and minutes separated by colon, i.e. H:MM
     */
    public static String formatMinutes(int minutes) {
        int hours = minutes / 60;
        int minuteRemainder = minutes % 60;

        return String.format("%d:%02d", hours, minuteRemainder);
    }
}

Related

  1. calculateDayMinutes(String dayBegin, String dayEnd)
  2. calculateHourMinute(long ms)
  3. correctMinuteFormat(String minute)
  4. formatMinutes(double value)
  5. formatMinutes(long time)
  6. formatMinutes(long time)
  7. formatMinutes(long time, String timerPrecisionId, boolean round)
  8. formatMinutes(long timeMinutes)