Std.Instant
Instant
Section titled “Instant”opaque type InstantA point in time. The current one is returned by Clock.now.
from_unix_milliseconds
Section titled “from_unix_milliseconds”fn from_unix_milliseconds(ms: Int64) -> InstantNegative values are before the epoch.
to_unix_milliseconds
Section titled “to_unix_milliseconds”fn to_unix_milliseconds(t: Instant) -> Int64Milliseconds since the Unix epoch. Negative before the epoch.
fn add(t: Instant, d: Duration) -> InstantEarlier if d is negative.
subtract
Section titled “subtract”fn subtract(t: Instant, d: Duration) -> Instantd earlier. Later if d is negative.
fn since(t: Instant, earlier: Instant) -> DurationThe duration from earlier to t; negative if earlier is later.
Reads as now.since(start).
to_string
Section titled “to_string”fn to_string(t: Instant) -> StringThe date and time in UTC (2026-10-12T03:04:05.678Z), an RFC 3339 date-time for years 0 to
9999. Other years are written with a sign and at least six digits (+010000, -000001), the
expanded year of ISO 8601. The format is in spec [api.std.instant].
fn parse(s: String) -> Instant fails ParseErrorThe point in time written in s: a date and time with an offset from UTC, in the form that
to_string writes, the date-time of RFC 3339, and a few more (2025-10-12 12:04:05.678+09).
The offset is required. Fails with ParseError(input: s) otherwise. The grammar is in spec
[api.std.instant].