Esc

duration_between

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

Returns exact b minus a without calendar interpretation.

Signature

duration_between :: (a: Timestamp, b: Timestamp) -> Signed_Duration
Example↗
a, _ := timestamp_from_seconds(10);
b, _ := timestamp_from_seconds(25);
elapsed := duration_between(a, b);
assert(elapsed.seconds == 15);

See also