time/date/locality.ha
raw| 1 | // SPDX-License-Identifier: MPL-2.0 |
| 2 | // (c) Hare authors <https://harelang.org> |
| 3 | |
| 4 | use time::chrono; |
| 5 | |
| 6 | // Creates a simultaneous [[date]] with a different [[locality]]. |
| 7 | // |
| 8 | // [[time::chrono::tscmismatch]] is returned if the [[time::chrono::timescale]]s |
| 9 | // of the given moment and the target [[locality]] are different. |
| 10 | export fn in(loc: locality, d: date) (date | chrono::tscmismatch) = { |
| 11 | return from_moment(loc, to_moment(d)); |
| 12 | }; |