Esc

time_zone_system

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

Uses TZ, otherwise /etc/localtime; Windows without TZ returns UNSUPPORTED.

Signature

time_zone_system :: (options: Time_Options = .{}) -> (Time_Zone, Time_Error)
Example↗
zone, error := time_zone_system();
if error.kind == .NONE {
    defer time_zone_free(*zone);
    wall := to_civil(zone, timestamp_now());
    print("local hour: %\n", wall.time.hour);
}

See also