Type Hierarchy:
Satisfied Interfaces: Comparable<Instant>, ReadableInstant

A specific instant of time on a continuous time-scale.

An instant represents a single point in time irrespective of any time-zone offsets or geographical locations.

Initializer
Instant(Integer millisecondsOfEpoch)
Parameters:
  • millisecondsOfEpoch

    Internal value of an instant as a number of milliseconds since 1970-01-01T00:00:00.000Z.

Attributes
hashSource Code
shared actual Integer hash

This implementation respect the constraint that if x==y then x.hash==y.hash.

Refined declaration: hash
millisecondsOfEpochSource Code
shared actual Integer millisecondsOfEpoch

Internal value of an instant as a number of milliseconds since 1970-01-01T00:00:00.000Z.

Refined declaration: millisecondsOfEpoch
stringSource Code
shared actual String string

Returns ISO-8601 formatted String representation of this time of day.

Reference: https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC

Refined declaration: string
Inherited Attributes
Attributes inherited from: ReadableInstant
Methods
compareSource Code
shared actual Comparison compare(Instant other)

Compares this instant to the other instant.

Refined declaration: compare
dateSource Code
shared Date date(TimeZone timeZone = ...)

Returns this instant as a Date value.

Parameters:
  • timeZone = tz.system
dateTimeSource Code
shared DateTime dateTime(TimeZone timeZone = ...)

Returns this instant as a DateTime value.

Parameters:
  • timeZone = tz.system
durationFromSource Code
shared Duration durationFrom(Instant other)

Returns duration in milliseconds from other instant to this instant.

durationToSource Code
shared Duration durationTo(Instant other)

Returns duration in milliseconds from this instant to the other instant.

equalsSource Code
shared actual Boolean equals(Object other)

Returns true if given value is same type and milliseconds of epoch.

Refined declaration: equals
minusSource Code
shared Instant minus(Duration|Period other)

Subtracts a period to this instant.

plusSource Code
shared Instant plus(Duration|Period other)

Adds a period to this instant.

timeSource Code
shared Time time(TimeZone timeZone = ...)

Returns time of day for this instant.

Parameters:
  • timeZone = tz.system
zoneDateTimeSource Code
shared ZoneDateTime zoneDateTime(TimeZone timeZone = ...)

Returns ZoneDateTime value for this instant.

Parameters:
  • timeZone = tz.system
Inherited Methods
Methods inherited from: Comparable<Other>
compare