List of utility methods to do Minute
int | numberOfMinutesForDays(int days) number Of Minutes For Days return 60 * 24 * days;
|
String | refineHourMinute(String timeString) Prepare the a user-entered time string to represent "hours:minutes". String ret = timeString.replace('.', ':'); ret = ret.replaceAll("^(\\d):", "0$1:"); ret = ret.replaceAll(":(\\d)$", ":0$1"); return ret; |
int | samplesToMinutes(int sampleRate, int samples) Calculates how many minutes samples are with sampleRate .
return Math.round(((float) samples / sampleRate) / 60.0f); |
long | secsToMinutes(long secs) secs To Minutes return secs / SECONDS_IN_MINUTE;
|
long | selectOfToday(int hour, int minute, int second, int millisecond) select Of Today Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minute);
calendar.set(Calendar.SECOND, second);
calendar.set(Calendar.MILLISECOND, millisecond);
Date date = calendar.getTime();
return date.getTime();
|
int | shortTimeToMinutes(String time) short Time To Minutes return Integer.parseInt(time.substring(0, 2)) * 60 + Integer.parseInt(time.substring(3, 5));
|
boolean | sleepToNextMinute() sleep To Next Minute try { long current = System.currentTimeMillis(); Thread.sleep(ONE_MINUTE - current % ONE_MINUTE + 500); return true; } catch (InterruptedException e) { return false; |
String | TimeDeltaString_JustMinutesSecs(long ms) Time Delta Strin Just Minutes Secs int secs = (int) (ms / 1000 % 60); int mins = (int) (ms / 1000 / 60 % 60); return String.format("%02dm %02ds", mins, secs); |
String | timeFromMinutes(Long minutes) Converts a time interval from minutes to a minutes/hours time string. I.E.: 123 > "2 h 3 min", 45 > "45 min" if (minutes > 60) { Long hours = (long) Math.floor(minutes / 60); minutes -= hours * 60; return hours + " h " + minutes + " min"; } else return minutes + " min"; |
int | toXMinutes(float t) to X Minutes t = t / 60; return (int) (t); |