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

byteGetTimeFromSeconds(double time)
Get Time From Seconds
double timeConstant = 0.25;
int counter = 0;
int value = 0;
do {
    if ((value = (int) (time / timeConstant)) <= 15) {
        return (byte) (counter * 16 + value);
    timeConstant = timeConstant * 2;
...
StringgetTimeFromSeconds(int seconds)
get Time From Seconds
if (seconds > 60) {
    int minutes = seconds / 60;
    seconds = seconds % 60;
    if (minutes > 60) {
        int hours = minutes / 60;
        minutes = minutes % 60;
        if (hours > 24) {
            int days = hours / 24;
...
longgetTimeInSecondResolution(long timeMillis)
get Time In Second Resolution
return timeMillis / 1000 * 1000;
intgetTimeSeconds(String time)
get Time Seconds
long mili = getTimeMillis(time);
return Math.round(mili / 1000);
StringgetTimeStringFromSeconds(int totalSeconds)
get Time String From Seconds
int minutes = totalSeconds / 60;
int seconds = totalSeconds % 60;
String minutesString = "" + minutes;
String secondsString = "" + seconds;
if (seconds < 10) {
    secondsString = "0" + secondsString;
return minutesString + ":" + secondsString;
...
intgetTokenRenewIntervalInSeconds(int tokenValidityInSeconds)
get Token Renew Interval In Seconds
if (tokenValidityInSeconds >= 300) {
    return tokenValidityInSeconds - 30;
} else if (tokenValidityInSeconds >= 60) {
    return tokenValidityInSeconds - 10;
} else {
    return (tokenValidityInSeconds - 1) > 0 ? tokenValidityInSeconds - 1 : 0;
intgetUnitLengthSeconds(String unit)
get Unit Length Seconds
unit = unit.trim();
if (unit.equals("seconds") || unit.equals("second") || unit.equals("secs") || unit.equals("sec")
        || unit.equals("s")) {
    return 1;
} else if (unit.equals("minutes") || unit.equals("minute") || unit.equals("mins") || unit.equals("min")) {
    return 60;
} else if (unit.equals("hours") || unit.equals("hour") || unit.equals("hrs") || unit.equals("hr")
        || unit.equals("h")) {
...
intgetUnixTimeSeconds()
get Unix Time Seconds
return (int) (System.currentTimeMillis() / 1000);
intgetUSeconds(int time)
get U Seconds
int useconds = (time & (0xFFFFFFFF >>> 11));
return useconds;
intgetValidCodeSecond()
get Valid Code Second
return VALID_CODE_SECOND;