Esc

time_of_day

procedureextensionsince 0.36.1Source
  • macOS: time_of_day works on macOS
  • Linux: time_of_day works on Linux
  • Windows: time_of_day works on Windows
  • Wasm: time_of_day works on Wasm

Validates a clock reading; leap seconds are rejected.

Signature

time_of_day :: (
    hour: s64,
    minute: s64,
    second: s64,
    nanosecond: s64 = 0
) -> (Time_Of_Day, Time_Error)
Example
t, error := time_of_day(23, 59, 59, 1);
assert(error.kind == .NONE && t.nanosecond == 1);
_, bad := time_of_day(24, 0, 0);
assert(bad.kind == .INVALID_VALUE);

See also