Class InstantKt
-
- All Implemented Interfaces:
public final class InstantKt
-
-
Method Summary
Modifier and Type Method Description final static BooleanisFinite(Instant $self)final static BooleanisInfinite(Instant $self)final static Instantmax(Instant a, Instant b)Returns the maximum of two Instants final static Instantmin(Instant a, Instant b)Returns the minimum of two Instants final static StringformatMilli(Instant $self)final static LongtoEpochMicro(Instant $self)Converts this instant to the number of microseconds from the epoch of 1970-01-01T00:00:00Z. final static InstantinstantOfEpochMicro(Long epochMicro)Obtains an instance of {@code Instant} using microseconds from the epoch of 1970-01-01T00:00:00Z. final static LongtoRoundedEpochMilli(Instant $self)Like Instant.toEpochMilli, but rounded to nearest rather than rounded to zero. final static LongroundedMillis(Clock $self)Like Clock.millis, but rounded to nearest rather than rounded to zero. -
-
Method Detail
-
isInfinite
final static Boolean isInfinite(Instant $self)
-
formatMilli
final static String formatMilli(Instant $self)
-
toEpochMicro
final static Long toEpochMicro(Instant $self)
Converts this instant to the number of microseconds from the epoch of 1970-01-01T00:00:00Z.
If this instant represents a point on the time-line too far in the future or past to fit in a
longmicroseconds, then an exception is thrown.If this instant has greater than microseconds precision, then the conversion will drop any excess precision information as though the amount in nanoseconds was subject to integer division by one thousand.
- Returns:
the number of microseconds since the epoch of 1970-01-01T00:00:00Z
-
instantOfEpochMicro
final static Instant instantOfEpochMicro(Long epochMicro)
Obtains an instance of {@code Instant} using microseconds from the epoch of 1970-01-01T00:00:00Z.
<p> The seconds and nanoseconds are extracted from the specified microseconds.- Parameters:
epochMicro- the number of microseconds from 1970-01-01T00:00:00Z- Returns:
an instant, not null
-
toRoundedEpochMilli
final static Long toRoundedEpochMilli(Instant $self)
Like Instant.toEpochMilli, but rounded to nearest rather than rounded to zero.
This is needed to be bit-exact with WebRTC unit tests, since libwebrtc clocks round this way
-
roundedMillis
final static Long roundedMillis(Clock $self)
Like Clock.millis, but rounded to nearest rather than rounded to zero.
-
-
-
-