time

native module

Clocks, sleeping, and RFC-3339 formatting. import "time".

time.now() => float

Current time as fractional Unix seconds.

time.unix() => int

Current time as whole Unix seconds.

time.millis() => int

Current time as whole Unix milliseconds.

time.sleep(ms: int)

Sleep for ms milliseconds.

time.since(start: float) => float

Elapsed seconds since a Unix-seconds start.

time.format_rfc3339(unix_secs: int) => (string, string?)

Render Unix seconds as a UTC RFC-3339 string.

time.parse_rfc3339(s: string) => (int, string?)

Parse an RFC-3339 string to Unix seconds.

time.components(unix_secs: int) => map

UTC breakdown: year, month, day, hour, minute, second, weekday.

On this page