Java Minute Parse parseMinutes(String timeInMinutes)

Here you can find the source of parseMinutes(String timeInMinutes)

Description

parse Minutes

License

Open Source License

Declaration

public static String parseMinutes(String timeInMinutes) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String parseMinutes(String timeInMinutes) {
        if (timeInMinutes == null)
            return null;
        int time = Integer.parseInt(timeInMinutes);
        int minutes = time % 60;
        String pad = (minutes < 10 ? "0" : "");
        return "" + (int) Math.floor(time / 60) + ":" + pad + minutes;
    }/*from w w w.ja va 2s  .c  o m*/

    public static String parseMinutes(Integer timeInMinutes) {
        if (timeInMinutes == null)
            return null;
        int time = timeInMinutes;
        int minutes = time % 60;
        String pad = (minutes < 10 ? "0" : "");
        return "" + (int) Math.floor(time / 60) + ":" + pad + minutes;
    }
}

Related

  1. parseHHMMStringToMinutes(String time)
  2. parseHourAndMinute(String value)
  3. parseIntForMinute(Integer i)
  4. parseMinutes(long time)
  5. parseMinutes(String minutes, int defaultValue)