locality.ha (413B)
1 // SPDX-License-Identifier: MPL-2.0 2 // (c) Hare authors <https://harelang.org> 3 4 use time::chrono; 5 6 // Creates an equivalent [[date]] with a different 7 // [[time::chrono::locality]]. 8 // 9 // The [[time::chrono::discontinuity]] rules from [[time::chrono::in]] apply here. 10 export fn in(loc: chrono::locality, d: date) (date | chrono::discontinuity) = { 11 return from_moment(chrono::in(loc, *(&d: *chrono::moment))?); 12 };