Here you can find the source of toMinutes(long millis)
public static String toMinutes(long millis)
//package com.java2s; //License from project: Open Source License public class Main { public static String toMinutes(long millis) { return toString(millis, "m"); }/* ww w . j a va2 s . co m*/ public static String toString(long millis, String unit) { double factor = getFactor(unit); return ((double) millis) / factor + unit; } private static long getFactor(String value) { long factor = 0; if (value.endsWith("ms")) { factor = 1; } else if (value.endsWith("s")) { factor = 1000; } else if (value.endsWith("m")) { factor = 1000 * 60; } else if (value.endsWith("h")) { factor = 1000 * 60 * 60; } else if (value.endsWith("d")) { factor = 1000 * 60 * 60 * 24; } return factor; } }