hare

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

commit 8fa6738f003c8b7d36a4bea7c0c717a9a10f296c
parent d9743f34c744f048f652cbb50e7790171d240c5c
Author: Byron Torres <b@torresjrjr.com>
Date:   Tue, 24 May 2022 04:00:26 +0100

time::chrono: add GPS and TT timezones

Signed-off-by: Byron Torres <b@torresjrjr.com>

Diffstat:
Mtime/chrono/timezone.ha | 38++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+), 0 deletions(-)

diff --git a/time/chrono/timezone.ha b/time/chrono/timezone.ha @@ -267,6 +267,44 @@ const TZ_TAI: timezone = timezone { posix_extend = "", }; +// The GPS (Global Positioning System) "Zulu" [[timezone]] as a [[locality]]. +export const GPS: locality = &TZ_GPS; + +const TZ_GPS: timezone = timezone { + name = "", + timescale = &gps, + daylength = EARTH_DAY, + zones = [ + zone { + zoffset = 0 * time::SECOND, + name = "Global Positioning System", + abbr = "GPS", + dst = false, + }, + ], + transitions = [], + posix_extend = "", +}; + +// The TT (Terrestrial Time) "Zulu" [[timezone]] as a [[locality]]. +export const TT: locality = &TZ_TT; + +const TZ_TT: timezone = timezone { + name = "", + timescale = &tt, + daylength = EARTH_DAY, + zones = [ + zone { + zoffset = 0 * time::SECOND, + name = "Terrestrial Time", + abbr = "TT", + dst = false, + }, + ], + transitions = [], + posix_extend = "", +}; + // The MTC (Coordinated Mars Time) "Zulu" [[timezone]] as a [[locality]]. export const MTC: locality = &TZ_MTC;