Esc

time_zone_from_posix

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

Parses POSIX TZ rules including M/J/Julian forms and extended transition times.

Signature

time_zone_from_posix :: (
    text: string,
    options: Time_Options = .{}
) -> (Time_Zone, Time_Error)
Example↗
zone, error := time_zone_from_posix("EST5EDT,M3.2.0,M11.1.0");
assert(error.kind == .NONE);
defer time_zone_free(*zone);
summer, _ := parse(Timestamp, "2024-07-01T00:00:00Z");
assert(offset_at(zone, summer).seconds == -14400);

See also