public class TimeUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static long |
ONE_SECOND
Constant that contains the amount of milliseconds in a second
|
Constructor and Description |
---|
TimeUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
convertTimeToInt(long seconds)
Converts a long seconds value to an int seconds value and takes into account overflow
from the downcast by switching to Integer.MAX_VALUE.
|
static long |
toMillis(int timeInSecs)
Converts seconds to milliseconds, with a precision of 1 second
|
static int |
toSecs(long timeInMillis)
Converts milliseconds to seconds
|
static final long ONE_SECOND
public static int toSecs(long timeInMillis)
timeInMillis
- public static long toMillis(int timeInSecs)
timeInSecs
- the time in secondspublic static int convertTimeToInt(long seconds)
seconds
- Long value