Java Utililty Methods Milli Second to Minute

List of utility methods to do Milli Second to Minute

Description

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

Method

long_toBeginOfMinute(long millis)
to Begin Of Minute
return millis - (millis % (60 * 1000));
StringasHoursMinutesSeconds(long milliseconds)
as Hours Minutes Seconds
if (milliseconds < 0) {
    throw new IllegalArgumentException();
long seconds = 0;
long minutes = 0;
long hours = 0;
if (milliseconds > 1000) {
    seconds = milliseconds / 1000;
...
long[]daysHoursMinutes(long p_milliseconds)
Convert the given number of milliseconds into an array of longs, where each long represents the days, hours, minutes respectively.
return daysHoursMinutes(p_milliseconds, HOURS_PER_DAY);
longdaysHoursMinutesToMillis(String expression)
Computes milliseconds from an expression [dd:][HH:]mm.
String[] ddHHmm = expression.split(":");
long total = 0;
int j = 2;
for (int i = ddHHmm.length - 1; i >= 0; i--)
    total += (Integer.parseInt(ddHHmm[i]) * MILLIS_EQUIV[j--]);
return total;
long[]hoursMinutes(long p_milliseconds)
Convert the given number of milliseconds into an array of longs, where each long represents the hours, and minutes respectively.
long[] hm = new long[2];
long seconds = p_milliseconds / MILLIS_PER_SECOND;
long minutes = seconds / SECONDS_PER_MINUTE;
long hours = minutes / MINUTES_PER_HOUR;
minutes -= (hours * MINUTES_PER_HOUR);
hm[0] = hours;
hm[1] = minutes;
return hm;
...
booleanisLessThanMinute(final long timeInMillis)
Checks if a number of milliseconds is less than a minute or not.
return timeInMillis >= 0 && timeInMillis < NUMBER_OF_MILLISECONDS_LESS_THAN_MINUTE;
booleanisSameMinuteOfMillis(final long ms1, final long ms2)
is Same Minute Of Millis
final long interval = ms1 - ms2;
return interval < MILLIS_IN_MINUTE && interval > -1L * MILLIS_IN_MINUTE
        && (ms1 / MILLIS_IN_MINUTE == ms2 / MILLIS_IN_MINUTE);
longmillis2minutes(long millis)
millisminutes
return millis / (1000 * 60);
StringmillisecondsToMinutes(long ms)
Convert from milliseconds to minutes.
int minutes = (int) (ms / (MS_PER_S * S_PER_M));
return minutes + "m";
DoublemillisecondToMinute(Long millisecond)
millisecond To Minute
return (millisecond) / (60 * 1000 * 1d);