List of utility methods to do Milliseconds
int | ticksToMilliseconds(long ticks) Extracts the milliseconds component of a time in millisecond ticks. return (int) (ticks % MILLIS_PER_SECOND); |
long | ticksWithMillisecondsSetTo(long ticks, int milliseconds) Sets the milliseconds component of the timestamp, returning the new timestamp with updated component. long oldMillis = ticksToMilliseconds(ticks); return ticks - oldMillis + milliseconds; |
long | tilNextMillis(long lastTimestamp) til Next Millis long timestamp = timeGen(); while (timestamp <= lastTimestamp) { timestamp = timeGen(); return timestamp; |
long | timeAfterMillis(final long millis) Returns timestamp in the future after some millis passed from now return System.currentTimeMillis() + millis;
|
String | timeIncMillisToTimeControl(long startTimeMillis, long startIncMillis) [TimeControl "60+0"] String minutes = String.valueOf(startTimeMillis / 1000); String inc = String.valueOf(startIncMillis / 1000); return minutes + "+" + inc; |
Date | timeMillisToDate(Long timeMillis) time Millis To Date SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String sd = format.format(new Date(timeMillis)); Date date = format.parse(sd); return date; |
String | timeMillisToString(long timeMillis) time Millis To String StringBuilder strTime = new StringBuilder(); long jour = (int) (timeMillis / 86400000); long heure = (int) ((timeMillis - jour * 86400000) / 3600000); long minute = (int) ((timeMillis - jour * 86400000 - heure * 3600000) / 60000); long seconde = (int) ((timeMillis - jour * 86400000 - heure * 3600000 - minute * 60000) / 1000); long milliseconde = (int) (timeMillis - jour * 86400000 - heure * 3600000 - minute * 60000 - seconde * 1000); if (jour > 0) { ... |
int | timeoutPropertyToIntMillis(long value) timeout Property To Int Millis if (value < 0) { return -1; } else if (value >= Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return (int) value; |
long | timeSince_MILLIS(long start_PMILLIS) time SincMILLIS return (System.currentTimeMillis() - start_PMILLIS);
|
long | timeSinceMillis(long prevTime) Get the time in millis passed since a previous time return millis() - prevTime;
|