Java Utililty Methods Minute Format

List of utility methods to do Minute Format

Description

The list of methods to do Minute Format are organized into topic(s).

Method

StringformatTimeInMinutes(long l)
format Time In Minutes
if (l <= 0)
    return null;
long mins = l / 1000 / 60;
if (l > 0) {
    return String.valueOf(mins) + " min";
return "";
StringgetFormattedHoursAndMinutes(final long millis)
get Formatted Hours And Minutes
final long seconds = millis / 60000;
final int hours = (int) seconds / 60;
final int minutes = (int) seconds % 60;
final StringBuilder buf = new StringBuilder();
buf.append(hours).append(":"); 
formatNumber(buf, minutes); 
return buf.toString();
StringtoReadableMinutes(long time)
Converts a time format in long form to a human-readable minute value
if (time > 3600) {
    return String.format("%d:%02d:%02d", time / 3600, (time % 3600) / 60, (time % 60));
} else {
    return String.format("%d:%02d", (time % 3600) / 60, (time % 60));