Java Utililty Methods Minute Get

List of utility methods to do Minute Get

Description

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

Method

longcurrentTimeMinutes()
current Time Minutes
return currentTimeSeconds() / 60L;
longfromMinutes(long seed)
from Minutes
return 60 * fromSeconds(seed);
StringgetCompleteDayAsHourMinuteString()
Returns a String representing the amount of time for a complete day (24 hours).
return "24:00";
StringgetElapsedTimeHoursMinutesFromMilliseconds(long milliseconds)
elapsed time in hours/minutes/seconds
String format = String.format("%%0%dd", 2);
long elapsedTime = milliseconds / 1000;
String seconds = String.format(format, elapsedTime % 60);
String minutes = String.format(format, (elapsedTime % 3600) / 60);
String hours = String.format(format, elapsedTime / 3600);
String time = hours + ":" + minutes + ":" + seconds;
return time;
StringgetFiveMinuteCronByHostId(long hostId)
get Five Minute Cron By Host Id
String baseCron = (hostId % 50) + " 0/5 * ? * *";
return baseCron;
StringgetFrequencyValueInMinutes(long value)
get Frequency Value In Minutes
if (value > 0) {
    long numHours = value / (1000 * 60);
    return String.valueOf(numHours) + " Minutes";
return "";
intgetHMTimeInMinutes(final String timeStr)
Parse a string of time (in hours and minutes) and return the time in minutes.
if ((timeStr == null) || (timeStr.trim().length() < 1)) {
    return 0;
final String time = timeStr.trim();
final int colonIndex = time.indexOf(':');
if (colonIndex < 0) {
    return getStringAsInteger(time, 0, 0);
} else if (colonIndex == 0) {
...
StringgetHourMinuteSecond(long misSecond)
get Hour Minute Second
if (misSecond < 0) {
    throw new IllegalArgumentException("The misSecond must not be negative");
long second = misSecond / 1000;
long hour = second / 3600;
long minute = (second % 3600) / 60;
long sec = second % 3600 % 60;
String hourStr = String.valueOf(hour);
...
StringgetHoursMinutesSeconds(float timeInSeconds)
Returns a string in the form hours:minutes:seconds for timeInSeconds .
int hours = (int) (timeInSeconds / 60 / 60);
int minutes = (int) (timeInSeconds / 60) - (hours * 60);
int seconds = (int) (timeInSeconds - (hours * 60 * 60) - (minutes * 60));
if (hours == 0) {
    return String.format("%d:%02d", minutes, seconds);
} else {
    return String.format("%d:%02d:%02d", hours, minutes, seconds);
StringgetLessThanOneMinuteAgoRendering()
get Less Than One Minute Ago Rendering
return "Less than one minute ago";