Java Utililty Methods Second Get

List of utility methods to do Second Get

Description

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

Method

StringgetNiceStringForSeconds(String timeInSeconds)
get Nice String For Seconds
try {
    float val = Float.parseFloat(timeInSeconds);
    if (val / 3600 > 1)
        return (val / 3600) + " h";
    else if (val / 60 > 1)
        return (val / 60) + " m";
    else
        return (val) + " s";
...
intgetNumberOfSecondsBetween(final double d1, final double d2)
get Number Of Seconds Between
if ((d1 == 0) || (d2 == 0)) {
    return -1;
return (int) (Math.abs(d1 - d2) / SECOND);
longgetRemainingSeconds(final long ms)
get Remaining Seconds
return ms / 1000 % 60;
longgetRoundedSeconds(long seconds, long interval)
get Rounded Seconds
long mod = seconds % interval;
if (mod == 0) {
    return seconds;
if (mod > (interval / 2)) {
    return (seconds - mod) + interval;
return seconds - mod;
...
intgetSecond(long container)
get Second
return (int) container;
intgetSecond(long time)
Gets the second.
return (int) ((time - getTime(getHour(time), getMinute(time), 0)) / 1000);
doublegetSecond(String date)
Get second
return Double.parseDouble(date.substring(15));
longgetSecondByDay(int day)
get Second By Day
return getSecondByHour(day * 24);
longgetSecondByHour(int hour)
get Second By Hour
return getSecondByMinute(hour * 60);
bytegetSecondByteFromInt(int num)
Returns the second byte of an integer.
return (byte) (num & 0xff);