Esc

Timestamp

structextensionsince 0.36.1Source
  • macOS: Timestamp works on macOS
  • Linux: Timestamp works on Linux
  • Windows: Timestamp works on Windows
  • Wasm: Timestamp works on Wasm

Declaration

Timestamp :: struct {
    seconds: s64;    nanoseconds: s32;}

Unix seconds and a signed subsecond remainder. The remainder is in -999999999..999999999 and has the seconds' sign when seconds != 0.

Example↗
instant, error := timestamp_from_millis(1500);
assert(error.kind == .NONE && instant.seconds == 1 && instant.nanoseconds == 500000000);

See also