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

intgetCurrentMiliseconds()
get Current Miliseconds
return (int) (System.currentTimeMillis() % 1000);
StringgetCurrentSecondString()
Returns a string of current timestamp with second precision.
return String.valueOf(System.currentTimeMillis() / 1000);
StringgetCurrentSecondZeroFillString()
Returns a string of timestamp with second precision and the length of LONG_TYPE_MAX_LENGTH .
return getCurrentSecondZeroFillString(LONG_TYPE_MAX_LENGTH);
LonggetCurrentTimeInSeconds()
get Current Time In Seconds
return System.currentTimeMillis() / 1000;
longgetCurrentTimeSeconds()
Get CurrentTime in Seconds
return System.currentTimeMillis() / 1000;
intgetDayFromSeconds(long seconds)
Converts the number of elapsed seconds from 0001/01/01 (YYYY/MM/DD) 00:00:00 to the corresponded date as the number of elapsed days.
return (int) (seconds / 86400);
intgetFramesFromSeconds(Double seconds)
Converts seconds to number of video frames.
return (int) Math.floor(seconds * FRAMES_PER_SECOND);
intgetMSTimeInSeconds(final String timeStr)
Parse a string of time (in minutes and seconds) and return the time in seconds.
if ((timeStr == null) || (timeStr.trim().length() < 1)) {
    return 0;
final String time = timeStr.trim();
final int colonIndex = time.indexOf(':');
if (colonIndex < 0) {
    return getStringAsInteger(time, 0, 0);
} else if (colonIndex == 0) {
...
doublegetMultiplierForCmPerSecondsFromSpeedUnits(String speedUnits)
get Multiplier For Cm Per Seconds From Speed Units
double mult = 1;
switch (speedUnits.trim().toLowerCase()) {
case "cm/s":
case "cm s-1":
case "cm s^-1":
case "cm.s^-1":
    mult = 1;
    break;
...
intgetNbSecondsFromHour(int hour)
get Nb Seconds From Hour
int n = ((hour / 10000) * 3600) + ((hour % 10000) / 100 * 60) + ((hour % 100));
return n;