Esc

offset_at

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

Resolves the offset at an exact instant, using footer rules beyond stored transitions.

Signature

offset_at :: (zone: Time_Zone, instant: Timestamp) -> Offset
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);
winter, _ := timestamp_from_seconds(1704067200);
assert(offset_at(zone, winter).seconds == -18000);

See also