Esc

Time_Transition

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

Declaration

Time_Transition :: struct {
    timestamp: Timestamp;    before: Offset;    after: Offset;    abbreviation_before: string;    abbreviation_after: string;}

One offset change. Abbreviation slices borrow the iterator's zone owner.

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, _, _ := next(*cursor);
assert(change.after.seconds - change.before.seconds == 3600);
assert(change.abbreviation_after == "EDT");

See also