List of utility methods to do Minute Convert
int | convertMinutesToSeconds(int minutesToConvert) converts a given time from minutes -> seconds return minutesToConvert * 60;
|
String | convertMsToMinutesAndSeconds(long ms) Convert milliseconds to mm:ss display format Note we don't break into hours, 3900000 ms would display as 65:00 , and we dont put a zero before single digit minutes int seconds = (int) ((ms / 1000) % 60); int minutes = (int) (ms / 60000); String secondsStr = (seconds < 10 ? "0" : "") + seconds; return new String(minutes + ":" + secondsStr); |
String | convertOffsetToMinutesSeconds(int offset) Convert a given millisecond offset into mm:ss string format int seconds = (int) (offset / 1000); int minutes = seconds / 60; String strSeconds = new String(); seconds = seconds - (minutes * 60); if (seconds < 10) { strSeconds = "0" + seconds; } else { strSeconds = "" + seconds; ... |
String | convertOffsetToMinutesSecondsMillis(int offset) convert Offset To Minutes Seconds Millis int millis = offset; int seconds = (int) (millis / 1000); int minutes = seconds / 60; String strMillis = new String(); String strSeconds = new String(); String strMinutes = new String(); millis = millis - (seconds * 1000); seconds = seconds - (minutes * 60); ... |
String | convertSecondsToHoursMinutesSeconds(int offset) Converts a second offset into a friendlier hh:mm:ss format & returns the string. int seconds = offset; int minutes = seconds / 60; int hours = minutes / 60; String strSeconds = new String(); String strMinutes = new String(); seconds = seconds - (minutes * 60); minutes = minutes - (hours * 60); if (seconds < 10) { ... |
double | convertSecondsToMinutes(double seconds) convert Seconds To Minutes return seconds / 60;
|
String | convertTicksToMinutesAndSeconds(int ticks, boolean fraction) Takes in the amount of ticks, and converts it into a time notation. String part = ticks % 20 * 5 + ""; if (part.length() < 2) part = "0" + part; ticks /= 20; if (ticks < 60) { return ticks + (fraction ? "." + part : "") + "s"; } else { return ticks / 60 + "m"; ... |
long | convertTimemilisecondsToMinutes(long time) convert Timemiliseconds To Minutes long minutes = 0; minutes = time / (60 * 1000); return minutes; |
String | minutesToHHMM(int mins) minutes To HHMM String result = ""; int hours = mins / 60, minutes = mins % 60; String disHour = (hours < 10 ? "0" : "") + hours, disMinu = (minutes < 10 ? "0" : "") + minutes; result = disHour + ":" + disMinu; return result; |
long | minutesToMillis(double minutes) utility to convert a given number of minutes to milliseconds return (long) (minutes * 60 * 1000); |