Skip to content

Time library

Note

This library will be included (and installed) with Keel in the 0.3.0 release that's coming soon.

Warning

This is highly subject to change.

Import this library with import "std/time.kl"; 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"