std.time [core] std.time.Instant pub struct Instant { ms: int, } — A reading of the MONOTONIC clock, in milliseconds from an arbitrary process-local anchor. std.time.Duration pub struct Duration { ms: int, } — A signed span of time, in milliseconds. std.time.now pub fn now() -> Instant — The current reading of the monotonic clock. std.time.monotonic_ns pub fn monotonic_ns() -> int — s248 ([os.clock.ns]): the monotonic clock in NANOSECONDS, from the anchor now reads (time_now_ms's): monotonic_ns() / 1000000 read after a now() is never smaller than its ms. std.time.unix_ms pub fn unix_ms() -> int — The current wall clock, in milliseconds since 1970-01-01T00:00:00Z. std.time.sleep pub fn sleep(d: Duration) — Block the calling thread for d. std.time.elapsed pub fn elapsed(since: Instant) -> Duration — How long ago since was read, on the monotonic clock. std.time.now_iso8601 pub fn now_iso8601() -> str — The wall clock, rendered — to_iso8601(unix_ms()). std.time.millis pub fn millis(n: int) -> Duration — A Duration of n milliseconds. std.time.seconds pub fn seconds(n: int) -> Duration — A Duration of n seconds. std.time.minutes pub fn minutes(n: int) -> Duration — A Duration of n minutes. std.time.hours pub fn hours(n: int) -> Duration — A Duration of n hours. std.time.as_millis pub fn as_millis(d: Duration) -> int — The millisecond count d names. std.time.as_seconds pub fn as_seconds(d: Duration) -> int — d in whole seconds, truncated TOWARD ZERO. std.time.as_minutes pub fn as_minutes(d: Duration) -> int — d in whole minutes, truncated toward zero. std.time.as_hours pub fn as_hours(d: Duration) -> int — d in whole hours, truncated toward zero. std.time.between pub fn between(earlier: Instant, later: Instant) -> Duration — The span from earlier to later, signed. std.time.add pub fn add(t: Instant, d: Duration) -> Instant — t advanced by d (which may be negative). std.time.is_before pub fn is_before(a: Instant, b: Instant) -> bool — Whether a is strictly before b on the monotonic clock. std.time.is_after pub fn is_after(a: Instant, b: Instant) -> bool — Whether a is strictly after b. std.time.plus pub fn plus(a: Duration, b: Duration) -> Duration — a + b. std.time.minus pub fn minus(a: Duration, b: Duration) -> Duration — a - b. std.time.negate pub fn negate(d: Duration) -> Duration — d with its sign flipped. std.time.is_zero pub fn is_zero(d: Duration) -> bool — Whether d is the zero span. std.time.is_negative pub fn is_negative(d: Duration) -> bool — Whether d runs backwards. std.time.to_iso8601 pub fn to_iso8601(unix_millis: int) -> str — unix_millis rendered as YYYY-MM-DDTHH:MM:SS.sssZ — the RFC 3339 profile of ISO 8601, in UTC, with exactly three fractional digits. std.time.unix_iso8601 pub fn unix_iso8601() -> str — unix_ms() rendered — see to_iso8601, which does the work. std.time.Local pub struct Local { year: int, month: int, day: int, hour: int, minute: int, second: int, nanos: int, offset_s: int, leap_correction_s: int, is_dst: bool, abbrev: str, } — Local Gregorian calendar fields; offset_s is seconds east of UTC, nanos 0..999999999, is_dst the zone's seasonal flag and abbrev its designation. std.time.local pub fn local(unix_s: int) -> Local ! {zone, io} — Local time at timestamp unix_s, from $TZ or /etc/localtime. std.time.local_in pub fn local_in(zone: str, unix_s: int) -> Local ! {zone, io} — Local time at unix_s: POSIX UNIX time without leap records, UNIX leap time with them (the same integer interpretation as host date). std.time.offset_at pub fn offset_at(zone: str, unix_s: int) -> int ! {zone, io} — Seconds east of UT in force in zone at timestamp unix_s. std.time.to_unix pub fn to_unix(l: Local) -> int — Timestamp of calendar fields at their EXPLICIT offset_s and leap_correction_s: UNIX leap time for leap-aware locals, POSIX UNIX time otherwise. std.time.format pub fn format(l: Local, fmt: str) -> str ! {format} — C-locale POSIX calendar formatting, pure and comptime-safe.