Here you can find the source of timeFromMinutes(Long minutes)
Parameter | Description |
---|---|
minutes | the minutes to convert |
public static String timeFromMinutes(Long minutes)
//package com.java2s; //License from project: Apache License public class Main { /**//from ww w. j a va 2s . c o m * Converts a time interval from minutes to a minutes/hours time string.<br/> * I.E.: 123 > "2 h 3 min", 45 > "45 min" * * @param minutes * the minutes to convert * @return the time interval string */ public static String timeFromMinutes(Long minutes) { if (minutes > 60) { Long hours = (long) Math.floor(minutes / 60); minutes -= hours * 60; return hours + " h " + minutes + " min"; } else return minutes + " min"; } }