Java Utililty Methods Second

List of utility methods to do Second

Description

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

Method

longsecondsAgo(int seconds)
seconds Ago
return now() - (seconds * SECOND);
intsecondsFromBeginningOfBoardcastEpoch()
seconds From Beginning Of Boardcast Epoch
return (int) ((System.currentTimeMillis() - BEGINNING_OF_BOARDCAST_TIME) / 1000);
doublesecondsSince(final long since)
Returns the number of seconds since the given time
return (System.currentTimeMillis() - since) / 1000.0;
StringsecondToString(long second)
second To String
long sec = second % 60;
second = second / 60;
long min = second % 60;
long hour = second = second / 60;
String nowTime = new String();
if (hour < 10) {
    if (hour == 0)
        nowTime = "00";
...
longstringToSeconds(String string)
string To Seconds
long seconds = 0;
String[] values = string.split(":");
seconds = Long.parseLong(values[0]) * 3600 + Long.parseLong(values[1]) * 60 + Long.parseLong(values[2]);
return seconds;
intstrTimeToSeconds(String hmsTimes)
str Time To Seconds
int seconds = 0;
String[] arrHMS = hmsTimes.split(":");
int h = Integer.parseInt(arrHMS[0]);
int m = Integer.parseInt(arrHMS[1]);
int s = Integer.parseInt(arrHMS[2]);
seconds = h * 3600 + m * 60 + s;
return seconds;
intticksToSeconds(long ticks)
Extracts the seconds component of a time in millisecond ticks.
return (int) (ticks % MILLIS_PER_MINUTE) / MILLIS_PER_SECOND;
longticksWithSecondsSetTo(long ticks, int seconds)
Sets the seconds component of the timestamp, returning the new timestamp with updated component.
long oldSeconds = ticksToSeconds(ticks);
return ticks - (oldSeconds * MILLIS_PER_SECOND) + (seconds * MILLIS_PER_SECOND);
doubletimecents2seconds(int timecents)
timecentsseconds
if (timecents <= -32768) {
    return 0.0;
return Math.pow(2.0, timecents / 1200.0);
doubletimeDecimalSeconds(String time)
Time converter.
return timeDecimal(time) * 3600;