OxL Reference

17.2 Arithmetic

  • Time ± Duration → Time, Time − Time → Duration, Instant − Instant → Duration.
  • Date ± Period → Date, ZonedTime ± Period → ZonedTime (calendar-wise, taking daylight saving transitions into account), ZonedTime ± Duration → ZonedTime (exactly).
  • 2d is exactly 48 hours (Duration); 2.days is two calendar days (Period).
  • ldt.in(tz): when ambiguous (clocks set back) the earlier time is chosen by default, ldt.in(tz, .Later) — the later one, .Reject — an error; a non-existent time (clocks set forward) is shifted forward.
  • Comparison and arithmetic between different kinds of time (for example Time and ZonedTime) is a compile error; conversion is explicit: zt.time, t.in(tz).
  • Adding a Period to a Time is forbidden: Time has no calendar.

time-mix

Source: docs/spec/oxl-standard.en.md