hare

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

commit b6b9bfb7f072826a18b755141c9b33285e7e79e1
parent ec2e0a925ae954999a073cae7c8a57c69df3f935
Author: Byron Torres <b@torresjrjr.com>
Date:   Mon, 24 Jan 2022 12:19:52 +0000

add timezone.posix_extend

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

Diffstat:
Mtime/chrono/timezone.ha | 11+++++++++++
Mtime/olson/olson.ha | 2++
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/time/chrono/timezone.ha b/time/chrono/timezone.ha @@ -23,6 +23,12 @@ export type timezone = struct { // The transitions between this timezone's zones transitions: []transition, + + // A timezone specifier in the POSIX "expanded" TZ format. + // See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html + // + // Used for extending calculations beyond the last known transition. + posix_extend: str, }; // A timezone state, with an offset for calculating localized civil time @@ -128,6 +134,7 @@ export fn fixedzone(ts: *timescale, daylen: time::duration, z: zone) timezone = daylength = daylen, zones = alloc([z]), transitions = [], + posix_extend = "", }; }; @@ -151,6 +158,7 @@ const TZ_local: timezone = timezone { }, ], transitions = [], + posix_extend = "", }; // The UTC (Coordinated Universal Time) "Zulu" timezone @@ -169,6 +177,7 @@ const TZ_UTC: timezone = timezone { }, ], transitions = [], + posix_extend = "", }; // The TAI (International Atomic Time) "Zulu" timezone @@ -187,6 +196,7 @@ const TZ_TAI: timezone = timezone { }, ], transitions = [], + posix_extend = "", }; // The MTC (Coordinated Mars Time) "Zulu" timezone @@ -205,4 +215,5 @@ const TZ_MTC: timezone = timezone { }, ], transitions = [], + posix_extend = "", }; diff --git a/time/olson/olson.ha b/time/olson/olson.ha @@ -50,6 +50,7 @@ const tz_europe__amsterdam: chrono::timezone = chrono::timezone{ }, ], transitions = [], + posix_extend = "", }; // CET (Central European Time) timezone @@ -74,4 +75,5 @@ const tz_cet: chrono::timezone = chrono::timezone{ }, ], transitions = [], + posix_extend = "", };