Time
let now (): Int
Seconds since the Unix epoch, from the system clock.
Seconds, and an Int, because that is what every platform's time() agrees on. Anything richer (a calendar date, a timezone, a formatted string) is a library on top of this and not a runtime concern; the primitive is the part a program cannot write for itself.
struct Instant
A point on the MONOTONIC clock, whose origin is deliberately unspecified. Two instants can be subtracted; one on its own means nothing, which is why this is a distinct type from a wall clock reading rather than another Int.
let nanos (n: Int): Duration
Constructors, each naming its unit. Multiplication can overflow, and Plum aborts on integer overflow rather than wrapping, so Time.seconds(10000000000) is a crash and not a silently wrong duration.
let micros (n: Int): Duration
A duration of n microseconds. Negative durations are allowed and mean what they say.
let millis (n: Int): Duration
A duration of n milliseconds. Negative durations are allowed and mean what they say.
let seconds (n: Int): Duration
A duration of n seconds. Negative durations are allowed and mean what they say.
let minutes (n: Int): Duration
A duration of n minutes. Negative durations are allowed and mean what they say.
let hours (n: Int): Duration
A duration of n hours. Negative durations are allowed and mean what they say.
let zero (): Duration
A duration of no time at all.
let now_millis (): Int
Wall clock, in milliseconds since the Unix epoch. The same clock now() reads, at a resolution now() cannot express.
It can jump: setting the system clock or an NTP correction moves it, backwards included. Use it to say WHEN something happened; use instant to measure how long something took.
let instant (): Instant
A reading of the monotonic clock, for measuring elapsed time. Never moves backwards and is unaffected by the system clock being set.
let since (t0: Instant): Duration
How long since t0. Never negative, because the clock it reads cannot go backwards.
let between (earlier: Instant) (later: Instant): Duration
The time between two instants, later - earlier. Negative if they are given the wrong way round, which is information rather than an error.
let sleep (d: Duration): Unit
Sleeps for AT LEAST d, never at most: a sleep overshoots by whatever the scheduler decides, and no caller can be promised otherwise. A non-positive duration returns immediately.
Windows sleeps in whole milliseconds, so a sub-millisecond request rounds UP to one there rather than down to nothing.
struct DateTime
A civil date and time, as UTC. weekday is 0 for Sunday.
let utc (epoch: Int): DateTime
Howard Hinnant's civil_from_days: exact for every date in the proleptic Gregorian calendar, with no lookup table and no leap-year special case. It shifts the year to start in March so the leap day falls at the END of the cycle, which is what removes the special case rather than hiding it.
The inner divisions all operate on non-negative values, so plain / is right there; only era can go negative and it uses the floor.
let weekday_name (weekday: Int): String
The English name of a weekday, 0 being Sunday, as Time.utc reports it. Out-of-range numbers give an empty string.
let month_name (month: Int): String
The English name of a month, 1 being January, as Time.utc reports it. Out-of-range numbers give an empty string.
let iso8601 (epoch: Int): String
2026-08-27T01:40:28Z, in ISO 8601, which is the one to reach for when a machine reads it back or when it needs to sort as text.
let rfc7231 (epoch: Int): String
Thu, 27 Aug 2026 01:40:28 GMT, the HTTP date format (RFC 7231), which is what a Last-Modified header and a good many generated files want.