Esc

transitions

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

Starts a borrowed cursor strictly after instant (strictly before when reverse).

Signature

transitions :: (
    zone: Time_Zone,
    instant: Timestamp,
    reverse := false
) -> Time_Transitions
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);
change, found, error := next(*cursor);
assert(error.kind == .NONE && found && change.after.seconds == -14400);

See also