Some rules in tz specification files seem to be applied (by zic) outside of their declared period of applicability
In the example shown below, copied from from tzdata2018i Africa file, the last Zone line, referencing the Namibia rule, should start at 1990 March 21 2:00 am. There are no Namibia transitions defined from that start, until 1994. However zic does create a transition using the second Namibia rule at the start time, as shown in the zdump output below. There are many other cases like this, where an UNTIL specification ends well before the next applicable rule of the following zone line. I am trying to read the zic manual page as a specification, and I do not understand why zic inserts that transition. It seems to me that either the last Zone line (SAST) would remain in effect until 1994, as there is no other transition defined, or that period is in an undefined state, as the SAST transition is not in effect after1990 March 21. Can someone correct my understanding? ------- Specification extract # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Vanguard section, for zic and other parsers that support negative DST. Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 1:30 - +0130 1903 Mar 2:00 - SAST 1942 Sep 20 2:00 2:00 1:00 SAST 1943 Mar 21 2:00 2:00 - SAST 1990 Mar 21 # independence # Vanguard section, for zic and other parsers that support negative DST. 2:00 Namibia %s ------ Zicdump output: $ zdump -v -c 1892,1996 Africa/Windhoek Africa/Windhoek -9223372036854775808 = NULL Africa/Windhoek -9223372036854689408 = NULL Africa/Windhoek Sun Feb 7 22:51:35 1892 UT = Sun Feb 7 23:59:59 1892 LMT isdst=0 gmtoff=4104 Africa/Windhoek Sun Feb 7 22:51:36 1892 UT = Mon Feb 8 00:21:36 1892 +0130 isdst=0 gmtoff=5400 Africa/Windhoek Sat Feb 28 22:29:59 1903 UT = Sat Feb 28 23:59:59 1903 +0130 isdst=0 gmtoff=5400 Africa/Windhoek Sat Feb 28 22:30:00 1903 UT = Sun Mar 1 00:30:00 1903 SAST isdst=0 gmtoff=7200 Africa/Windhoek Sat Sep 19 23:59:59 1942 UT = Sun Sep 20 01:59:59 1942 SAST isdst=0 gmtoff=7200 Africa/Windhoek Sun Sep 20 00:00:00 1942 UT = Sun Sep 20 03:00:00 1942 SAST isdst=1 gmtoff=10800 Africa/Windhoek Sat Mar 20 22:59:59 1943 UT = Sun Mar 21 01:59:59 1943 SAST isdst=1 gmtoff=10800 Africa/Windhoek Sat Mar 20 23:00:00 1943 UT = Sun Mar 21 01:00:00 1943 SAST isdst=0 gmtoff=7200 Africa/Windhoek Tue Mar 20 21:59:59 1990 UT = Tue Mar 20 23:59:59 1990 SAST isdst=0 gmtoff=7200 Africa/Windhoek Tue Mar 20 22:00:00 1990 UT = Wed Mar 21 00:00:00 1990 CAT isdst=0 gmtoff=7200 <------ zic inserted the 1994 "CAT" transition. How was this chosen? Africa/Windhoek Sun Mar 20 21:59:59 1994 UT = Sun Mar 20 23:59:59 1994 CAT isdst=0 gmtoff=7200 Africa/Windhoek Sun Mar 20 22:00:00 1994 UT = Sun Mar 20 23:00:00 1994 WAT isdst=1 gmtoff=3600 <----- first applicable rule in 1994. Africa/Windhoek Sun Sep 4 00:59:59 1994 UT = Sun Sep 4 01:59:59 1994 WAT isdst=1 gmtoff=3600 Africa/Windhoek Sun Sep 4 01:00:00 1994 UT = Sun Sep 4 03:00:00 1994 CAT isdst=0 gmtoff=7200 Africa/Windhoek Sat Apr 1 23:59:59 1995 UT = Sun Apr 2 01:59:59 1995 CAT isdst=0 gmtoff=7200 Africa/Windhoek Sun Apr 2 00:00:00 1995 UT = Sun Apr 2 01:00:00 1995 WAT isdst=1 gmtoff=3600 Africa/Windhoek Sun Sep 3 00:59:59 1995 UT = Sun Sep 3 01:59:59 1995 WAT isdst=1 gmtoff=3600 Africa/Windhoek Sun Sep 3 01:00:00 1995 UT = Sun Sep 3 03:00:00 1995 CAT isdst=0 gmtoff=7200 Africa/Windhoek 9223372036854689407 = NULL Africa/Windhoek 9223372036854775807 = NULL -------
On 2019-01-15 20:48, Parsifal Herzog wrote: I am trying to read the zic manual page as a specification, and I do not understand why
zic inserts that transition. It seems to me that either the last Zone line (SAST) would
remain in effect until 1994, as there is no other transition defined, or that period is in an undefined state, as the SAST transition is not in effect after1990 March 21.
Can someone correct my understanding?
Let me try. Your observation is correct: a "transition" in a tzdb zone time like Africa/Windhoek does not always imply a change in the time; it can also mean a change in the abbreviation, or in the value of the dst bit (or any combination of the three). In the case at hand, the abbreviation changes from SAST (for South African Standard Time) to CAT (Central African Time). This change is appropriate at the date when Namibia became independent from South Africa. Michael Deckers.
On 2019-01-16 4:41 a.m., Michael H Deckers wrote:
In the case at hand, the abbreviation changes from SAST (for South African Standard Time) to CAT (Central African Time). This change is appropriate at the date when Namibia became independent from South Africa.
Michael, this does not answer my question - I am sure that you do not mean to imply that zic has read the comment line and somehow "knows" that after independence, the time zone abbreviation is going to be "CAT". To make my question perfectly clear, I am going to go through this Africa/Windhoek example step by step. Please bear with me if some things I write are self-evident - I want to show my reasoning, in case somewhere I have made a false step or assumption. Before I do that, perhaps it would be helpful if you know the context in which my question arose: I have a program which parses the Olsen Tz data base textual specification, and produces time tables, as does zic. The context is in handling worldwide historical dates and times, so that other issues such as Gregorian/Julian transitions need to be accounted for. Recently there have been changes to the zone file specifications, such as negative dst and times, so while changing my program to accommodate these, I noticed that it was inserting standard time transitions in periods where no applicable zone Rule existed. I wondered how this could be - shouldn't it be an error to leave a gap in the specification? Investigating, I found that there were very many such cases, and even a few zone lines that had no applicable rule over the entire period covered by the zone line. The standard time transitions inserted to cover these gaps were fine (gmtoffset of the zone, and save = 0), but the timzone abbreviation was not so easy to determine - it could come from the zone line, i.e. "MSK/MSD", but more often the zone line had a format specification, and thus requires an applicable rule to work unambiugously. So the program "made up" a zone abbreviation using some heuristics, and it output a table of its guesses, which I could review and fix by hand if necessary. This was not very satisfactory, so I thought I must be missing something and I asked "What would zic do?". I got the source, and I didn't get much farther. My program is written in Python, zic is in C, and carries a lot of historical baggage that I am not familiar with. So then, on with my exposition, and hopefully the question will become clear enough to be answered: In this specific case I am using, I am asking: Where in the timezone specification of the Africa/Windhoek zone is it written that the abbreviation is changed from "SAST" to "CAT" as of Wed Mar 21 1990? As I interpret the zic manual page, the Zone line 2:00 - SAST 1990 Mar 21 # independence Specifies that as of 1990 Mar 21, midnight, the gmtoffset = 2:00, dst save = 0, and the timezone abbreviation = SAST, is no longer in effect. As of that time, the next Zone line: 2:00 Namibia %s comes into effect. This specifies that the gmtoffset shall be 2 hours, as of 1990 March 20 midnight, and that from that time onwards, one or more of the rules named "Namibia" will be applied according to their respective periods of applicability to determine changes of dst offset and timezone abbreviation, and when they will occur. Here again, for this example, are all of those rules: Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT As I read it, according to the zic manual page, NONE of these rules apply to the years 1990 through 1993. So the dst offset and abbreviation are undefined in those years. Yet zic, by some unspecified logic, has chosen the second rule, and entered the transition (according to zdump): Africa/Windhoek Tue Mar 20 22:00:00 1990 UT = Wed Mar 21 00:00:00 1990 CAT isdst=0 gmtoff=7200 So, what is this (so its seems to me) unspecified logic? This might read something like: During a time period where there is no applicable rule, the dst offset shall be ____ and the time zone abbreviation shall be _____. Where _____ is the answer I am looking for. Thank you, Parsifal
On 2019-01-16 19:10, Parsifal Herzog wrote:
On 2019-01-16 4:41 a.m., Michael H Deckers wrote: Before I do that, perhaps it would be helpful if you know the context in which my question arose: I have a program which parses the Olsen Tz data base textual specification, and produces time tables, as does zic. The context is in handling worldwide historical dates and times, so that other issues such as Gregorian/Julian transitions need to be accounted for.
Recently there have been changes to the zone file specifications, such as negative dst and times, so while changing my program to accommodate these, I noticed that it was inserting standard time transitions in periods where no applicable zone Rule existed.
In this specific case I am using, I am asking: Where in the timezone specification of the Africa/Windhoek zone is it written that the abbreviation is changed from "SAST" to "CAT" as of Wed Mar 21 1990?
As I interpret the zic manual page, the Zone line 2:00 - SAST 1990 Mar 21 # independence Specifies that as of 1990 Mar 21, midnight, the gmtoffset = 2:00, dst save = 0, and the timezone abbreviation = SAST, is no longer in effect. As of that time, the next Zone line: 2:00 Namibia %s comes into effect. This specifies that the gmtoffset shall be 2 hours, as of 1990 March 20 midnight, and that from that time onwards, one or more of the rules named "Namibia" will be applied according to their respective periods of applicability to determine changes of dst offset and timezone abbreviation, and when they will occur.
Here again, for this example, are all of those rules: Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT As I read it, according to the zic manual page, NONE of these rules apply to the years 1990 through 1993. So the dst offset and abbreviation are undefined in those years. Yet zic, by some unspecified logic, has chosen the second rule, and entered the transition (according to zdump): Africa/Windhoek Tue Mar 20 22:00:00 1990 UT = Wed Mar 21 00:00:00 1990 CAT isdst=0 gmtoff=7200
So, what is this (so its seems to me) unspecified logic? This might read something like: During a time period where there is no applicable rule, the dst offset shall be ____ and the time zone abbreviation shall be _____. Where _____ is the answer I am looking for.
The rearguard format fills in the blanks for non-zic compliant processors, but it appears that zic looks at the next rule for the same STD/DST offset or state and uses that abbreviation. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised.
zic computes transition times for each zone line (initial or continuation). As it processes each zone line, it looks for the first transition time after which standard time is in effect; the abbreviation in use after that transition is remembered (for readers of the code, remembered in "startbuf"). After all the transitions for a particular zone continuation line have been computed, zic tosses in a transition for the line's start time (the previous line's "until" time) (for readers of the code, it is the "if (usestart)" section near the end of the main loop in "outzone"). @dashdashado On Wed, Jan 16, 2019 at 9:11 PM Parsifal Herzog <parsifal.herzog@parz.ca> wrote:
On 2019-01-16 4:41 a.m., Michael H Deckers wrote:
In the case at hand, the abbreviation changes from SAST (for South African Standard Time) to CAT (Central African Time). This change is appropriate at the date when Namibia became independent from South Africa.
Michael, this does not answer my question - I am sure that you do not mean to imply that zic has read the comment line and somehow "knows" that after independence, the time zone abbreviation is going to be "CAT".
To make my question perfectly clear, I am going to go through this Africa/Windhoek example step by step. Please bear with me if some things I write are self-evident - I want to show my reasoning, in case somewhere I have made a false step or assumption.
Before I do that, perhaps it would be helpful if you know the context in which my question arose: I have a program which parses the Olsen Tz data base textual specification, and produces time tables, as does zic. The context is in handling worldwide historical dates and times, so that other issues such as Gregorian/Julian transitions need to be accounted for.
Recently there have been changes to the zone file specifications, such as negative dst and times, so while changing my program to accommodate these, I noticed that it was inserting standard time transitions in periods where no applicable zone Rule existed.
I wondered how this could be - shouldn't it be an error to leave a gap in the specification? Investigating, I found that there were very many such cases, and even a few zone lines that had no applicable rule over the entire period covered by the zone line.
The standard time transitions inserted to cover these gaps were fine (gmtoffset of the zone, and save = 0), but the timzone abbreviation was not so easy to determine - it could come from the zone line, i.e. "MSK/MSD", but more often the zone line had a format specification, and thus requires an applicable rule to work unambiugously. So the program "made up" a zone abbreviation using some heuristics, and it output a table of its guesses, which I could review and fix by hand if necessary.
This was not very satisfactory, so I thought I must be missing something and I asked "What would zic do?". I got the source, and I didn't get much farther. My program is written in Python, zic is in C, and carries a lot of historical baggage that I am not familiar with.
So then, on with my exposition, and hopefully the question will become clear enough to be answered:
In this specific case I am using, I am asking: Where in the timezone specification of the Africa/Windhoek zone is it written that the abbreviation is changed from "SAST" to "CAT" as of Wed Mar 21 1990?
As I interpret the zic manual page, the Zone line
2:00 - SAST 1990 Mar 21 # independence
Specifies that as of 1990 Mar 21, midnight, the gmtoffset = 2:00, dst save = 0, and the timezone abbreviation = SAST, is no longer in effect. As of that time, the next Zone line:
2:00 Namibia %s
comes into effect. This specifies that the gmtoffset shall be 2 hours, as of 1990 March 20 midnight, and that from that time onwards, one or more of the rules named "Namibia" will be applied according to their respective periods of applicability to determine changes of dst offset and timezone abbreviation, and when they will occur.
Here again, for this example, are all of those rules:
Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT
As I read it, according to the zic manual page, NONE of these rules apply to the years 1990 through 1993. So the dst offset and abbreviation are undefined in those years. Yet zic, by some unspecified logic, has chosen the second rule, and entered the transition (according to zdump):
Africa/Windhoek Tue Mar 20 22:00:00 1990 UT = Wed Mar 21 00:00:00 1990 CAT isdst=0 gmtoff=7200
So, what is this (so its seems to me) unspecified logic? This might read something like:
During a time period where there is no applicable rule, the dst offset shall be ____ and the time zone abbreviation shall be _____.
Where _____ is the answer I am looking for.
Thank you, Parsifal
Arthur David Olson wrote:
zic computes transition times for each zone line (initial or continuation). As it processes each zone line, it looks for the first transition time after which standard time is in effect; the abbreviation in use after that transition is remembered (for readers of the code, remembered in "startbuf"). After all the transitions for a particular zone continuation line have been computed, zic tosses in a transition for the line's start time (the previous line's "until" time) (for readers of the code, it is the "if (usestart)" section near the end of the main loop in "outzone").
Thanks for clarifying this point, which should be documented. I gave it a shot by installing the attached proposed patch.
On Jan 15, 2019, at 12:48 PM, Parsifal Herzog <parsifal.herzog@parz.ca> wrote:
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Vanguard section, for zic and other parsers that support negative DST. Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT
Namibia gained independence on 1990-03-21; what were the statutory time zone and DST rules from 1990-03-21 through 1994-03-20?
participants (6)
-
Arthur David Olson -
Brian Inglis -
Guy Harris -
Michael H Deckers -
Parsifal Herzog -
Paul Eggert