type Instant = Int64 where value >= 0
Milliseconds since the Unix epoch, UTC. A distinct type, so a timestamp does not mix with a plain count.
Type to search, or try , or .
15 exports, from std/time.vyrn.
Wall-clock time at the host boundary, and a pure calendar breakdown.
now() and monotonic() are host effects, so generators and comptime code cannot call them; the parity harness fixes the clock with VYRN_FIXED_TIME. The calendar breakdown and the formatters are pure. UTC only: no timezone database, no DST, no locale. Milliseconds since the Unix epoch, UTC. A distinct type, so a timestamp does not mix with a plain count.
The import graph shows the whole library.
type Instant = Int64 where value >= 0
Milliseconds since the Unix epoch, UTC. A distinct type, so a timestamp does not mix with a plain count.
type Civil = { year: Int64, month: Int64, day: Int64 }
A UTC calendar date, the pure breakdown of an Instant's day component.
fn now() -> Instant
The current wall-clock instant.
fn monotonic() -> Int64
Monotonic nanoseconds, for durations: now() jumps when the wall clock is set.
fn toMillis(i: Instant) -> Int64
fn fromMillis(n: Int64) -> Instant
An instant from raw epoch milliseconds, validated non-negative.
fn civil(i: Instant) -> Civil
The UTC calendar date (year/month/day) of an instant.
fn year(i: Instant) -> Int64
The UTC year of an instant.
fn month(i: Instant) -> Int64
The UTC month of an instant (1..12).
fn day(i: Instant) -> Int64
The UTC day-of-month of an instant (1..31).
fn hour(i: Instant) -> Int64
The UTC hour of an instant (0..23).
fn minute(i: Instant) -> Int64
The UTC minute of an instant (0..59).
fn second(i: Instant) -> Int64
The UTC second of an instant (0..59).
fn format(i: Instant) -> String
UTC timestamp YYYY-MM-DD HH:MM:SS.
fn formatIso(i: Instant) -> String
ISO-8601 UTC timestamp YYYY-MM-DDTHH:MM:SSZ.
This module carries no test block of its own.
2 programs in examples/ import this module. Each runs as WebAssembly and as a native binary.