Esc

Time_Transitions

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

Declaration

Time_Transitions :: struct {
    zone: Time_Zone;    cursor: Timestamp;    reverse: bool;    exhausted: bool;}

A constant-space cursor borrowing a zone.

Example↗
zone, zone_error := time_zone_from_posix("EST5EDT,M3.2.0,M11.1.0");
assert(zone_error.kind == .NONE);
defer time_zone_free(*zone);
start, _ := timestamp_from_seconds(1704067200);
cursor := transitions(zone, start);
_, found, error := next(*cursor);
assert(error.kind == .NONE && found);

See also