Instant class final

A point on the time line, to the millisecond, with no zone. Stands for Temporal's Instant; milliseconds since the epoch are what the indexes sort on (the TypeScript core's EpochMs).

Implemented types
Available extensions

Constructors

Instant.fromEpochMilliseconds(int epochMilliseconds)
const

Properties

epochMilliseconds → int
final
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Duration elapsed) → Instant
addMs(int ms) → Instant
compareTo(Instant other) → int
Compares this object to another object.
override
inZone(ZoneId zone) → ZonedDateTime

Available on Instant, provided by the InstantInZone extension

Throws ArgumentError when zone names no zone.
isAfter(Instant other) → bool
isBefore(Instant other) → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
"2026-03-29T01:00:00Z", as Temporal writes it.
override
until(Instant other) → Duration
Elapsed time from this instant to other.
wallAt(int offsetMs) → PlainDateTime
The clock face in UTC plus offsetMs: no zone asked.

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

parse(String text) → Instant
tryParse(String text) → Instant?
"2026-03-29T01:00:00Z", "2026-03-29T03:00:00+02:00", with or without a trailing [Europe/Paris] (an annotation: the offset decides). An instant needs its offset; a bare date-time is no instant.