Skip to content

Time library

Warning

This is highly subject to change.

Import this library with import std::time; at the top-level.

Now

time::now() -> int
Returns the number of seconds since January 1, 1970, 00:00:00 UTC.

Format

time::format(date: int, format: string) -> string
Formats date into a string according to the given format pattern.

print(time::format(time::now(), "%x - %X %p")); // prints "06/29/26 - 10:59:21 AM"