List of utility methods to do Second Convert
String | toHhMmSs(long seconds) to Hh Mm Ss DecimalFormat f = new DecimalFormat("00"); long h = seconds / 3600; long m = (seconds % 3600) / 60; long s = seconds % 60; return f.format(h) + ":" + f.format(m) + ":" + f.format(s); |
long | toNanoseconds(long sec, long nanos) to Nanoseconds long result = nanos; result = result + 1000000000 * sec; return result; |
String | toSeconds(double value) to Seconds return String.format("%6.3fB", value); |
long | toSeconds(long date) to Seconds return date / 1000L;
|
String | toSeconds(long millis) to Seconds return toString(millis, "s"); |
long | toSeconds(long milliseconds) This method strips milliseconds and returns seconds. return milliseconds / 1000;
|
double | toSeconds(long nanoseconds) Converts nanoseconds to seconds return toSeconds((double) nanoseconds); |
Double | toSeconds(long nanoSeconds) to Seconds return nanoSeconds / SECONDS;
|
long | toSecondsPrecisionInMs(long ms) Reduces the precision of a time in milliseconds to seconds precision. return ms - (ms % 1000);
|
String | toTimeStringNoSeconds(Date timeString) to Time String No Seconds return toDateString(timeString, "HH:mm"); |