duration.ha (360B)
1 // License: MPL-2.0 2 // (c) 2023 Byron Torres <b@torresjrjr.com> 3 use time; 4 5 // Adds a [[time::duration]] to a [[datetime]] with [[time::add]]. 6 // 7 // See [[reckon]] for a chronology-wise arithmetic operation which uses 8 // [[period]]. 9 export fn add(a: datetime, d: time::duration) datetime = { 10 return from_instant(a.loc, time::add(*(&a: *time::instant), d)); 11 };