tarithm.ha (341B)
1 // SPDX-License-Identifier: MPL-2.0 2 // (c) Hare authors <https://harelang.org> 3 4 use time; 5 6 // Adds a [[time::duration]] to a [[date]] with [[time::add]]. This is a 7 // timescalar aritmetic operation. 8 // 9 // See [[reckon]]. 10 export fn add(d: date, x: time::duration) date = { 11 return from_instant(d.loc, time::add(*(&d: *time::instant), x)); 12 };