List of utility methods to do Second Get
byte | GetTimeFromSeconds(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; ... |
String | getTimeFromSeconds(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; ... |
long | getTimeInSecondResolution(long timeMillis) get Time In Second Resolution return timeMillis / 1000 * 1000;
|
int | getTimeSeconds(String time) get Time Seconds long mili = getTimeMillis(time); return Math.round(mili / 1000); |
String | getTimeStringFromSeconds(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; ... |
int | getTokenRenewIntervalInSeconds(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; |
int | getUnitLengthSeconds(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")) { ... |
int | getUnixTimeSeconds() get Unix Time Seconds return (int) (System.currentTimeMillis() / 1000); |
int | getUSeconds(int time) get U Seconds int useconds = (time & (0xFFFFFFFF >>> 11)); return useconds; |
int | getValidCodeSecond() get Valid Code Second return VALID_CODE_SECOND;
|