hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

locality.ha (423B)


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