Esc

hours_in_day

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

Returns exact elapsed hours between consecutive local day starts.

Signature

hours_in_day :: (value: Zoned) -> (float64, Time_Error)
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);
day, _ := to_zoned(.{ .{ 2024, 3, 10 }, .{ 12, 0, 0, 0 } }, zone);
hours, error := hours_in_day(day);
assert(error.kind == .NONE && hours == 23);

See also