OxL Reference

op ZonedTime.-

The exact duration between two zoned instants.

Example:

oxl✓ checked in CI
use std.time { Time }

fn main() io {
  let a = Time.ofUnixSeconds(3600).in(tz"UTC")
  let b = Time.ofUnixSeconds(0).in(tz"Asia/Tokyo")
  print("{(a - b).minutes()}")
}
Output
60
pub(api) static op -(a: ZonedTime, b: ZonedTime) -> Dur

Since. 1.0.0-beta

Parameters

Returns

Dur

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:2304

See also