
I think there is an error in TZ, regarding begin of DST in Portugal in 1980. A user of my website pointed it out. file europe has
Rule Port 1978 only - Oct 1 0:00s 0 - Rule Port 1979 1982 - Sep lastSun 1:00s 0 - Rule Port 1980 only - Mar lastSun 0:00s 1:00 S Rule Port 1981 1982 - Mar lastSun 1:00s 1:00 S Rule Port 1983 only - Mar lastSun 2:00s 1:00 S
But Observatório Astronómico de Lisboa http://oal.ul.pt/hora-legal/legislacao-sobre-a-hora-legal/ has in document Tabela com a definição anual da Hora Legal portuguesa desde 1911 https://oal.ul.pt/documentos/2018/01/hl1911a2018.pdf
1980 Hora do meridiano de Greenwich até à 1 hora do dia 6 de Abril, instante em que foi adiantada de 60 minutos, tendo-se regressado à hiora do meri- diano de Greenwich às 2 horas do dia 28 de Setembro (Portaria nº 69/80)
I attach a patch file

On Thu, 29 Feb 2024 at 06:31, Alois Treindl via tz <tz@iana.org> wrote:
I think there is an error in TZ, regarding begin of DST in Portugal in 1980.
Some time ago, I'd looked into some other changes for Portugal and found that our data there, which is mostly from Shanks, likely needs a complete overhaul, much like I did for Uruguay in 2018 <https://mm.icann.org/pipermail/tz/2018-February/017706.html>. I'd made significant progress on this, working on data from Observatório Astronómico de Lisboa, before more important things came up and I had to shelve the branch. I just checked, and it seems I'd ended up with "Apr Sun>=1 1:00s" for 1980, which is equivalent to the law text you provided (at least for the mainland, "1 hora de tempo universal"), but not quite to your patch. But, for example, I'd also had that for 1978 and 1979 as well, which is an hour different to what's currently in tzdb for those years. If you'll allow me a few days to dust off and clean up what I had already for the mainland, I'd rather we take the time to ensure this is done right and not commit changes here in a piecemeal fashion. I imagine there might be a couple revisions before it ultimately lands in the repo, but as this is all historical there is no urgency. One thing I *know* I could use help with, and that we need to be careful of, is figuring out how changes to 'Port' rules, in use until 1983, affect Azores and Madeira. Since we seem to know that Portugal didn't harmonize with EU DST practice until 1992, I wouldn't want to guess that that's what was done 1916–1983. So if someone could help find *some* relevant text from that period, that would really help. https://diariodarepublica.pt/ -- Tim Parenti

(was: error Portugal 1980) On Thu, 29 Feb 2024 at 18:45, Alois Treindl via tz <tz@iana.org> wrote:
I have the impression that the document form the Lisbon astronomical observatory, which I linked in my first post, is quite reliable.
Yes, I had gotten the same impression when I began my research on this in 2021, though I did find what appears to be at least one error in even the Observatory's data based on the laws I inspected.
It names the law numbers, which are easy to find here https://diariodarepublica.pt/dr/home
Of course, but there are over 50 referenced decrees and ordinances, and the Observatory's listing for continental Portugal didn't mention the islands when we already knew there was some divergence from the mainland in the 1980s. Hence the call for assistance earlier. Thankfully, the Observatory has another page that lists the laws currently in force for the mainland and the islands: https://oal.ul.pt/hora-legal/legislacao/ Using those references, I was able to work backward through each law's revocations and abrogations to a clearer point, constructing a history for the islands. (Without those footholds, I would have had nowhere to even start.) Attached is a draft patch summing up the results of this research for the Portuguese mainland, the islands, and some of its former overseas territories. It is not yet ready for merge, as it still needs a NEWS item and commit message which I'll work on shortly, but more importantly it needs review from the list. There are a few editorial/stylistic decisions I made, mostly to keep things simpler, that could be changed if there are compelling reasons… but it should mostly only need spot-checks for correctness, which hopefully the added commentary will help with. The patch can also be reviewed (temporarily) on GitHub at: https://github.com/timparenti/tz-development/commit/0588a349673bfd5b4edadb3e... -- Tim Parenti

Thanks for doing all that work. I assume your Portuguese is a lot better now than it was a few weeks ago! I ran into one problem right away: "make DATAFORM=vanguard check" failed, with messages like this:
./zic -d check_now.dir tzdata.zi "tzdata.zi", line 3483: Zone continuation line end time is not after end time of previous line "tzdata.zi", line 3484: input line of unknown type "tzdata.zi", line 3485: input line of unknown type "tzdata.zi", line 3486: input line of unknown type
so it looks like some of the ifdeffed-ish lines need to be changed, in the vanguard section. Some other comments, about the colonial data: On 3/12/24 15:51, Tim Parenti via tz wrote:
--- a/africa +++ b/africa @@ -105,11 +105,11 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 16 # # From Paul Eggert (2018-02-16): # Shanks gives 1907 for the transition to +02. -# For now, ignore that and follow the 1911-05-26 Portuguese decree +# For now, ignore that and follow the 1911-05-24 Portuguese decree # (see Europe/Lisbon).
I suggest rephrasing this Africa/Cape_Verde comment to something like "For timestamps before independence see commentary for Europe/Lisbon." We don't need to mention Shanks any more since we're no longer relying on Shanks for any of this data. Likewise for Africa/Bissau and Africa/Luanda. For Africa/Maputo, it seems that we should change the transition time to be the time you found, and ignore Shanks there as well. Although Wikipedia says Lourenço Marques (as Maputo was then called) starting in 1904 had a tram service starting, which presumably had a need for reliable fixed GMT offset, it's possible that the tram service used one GMT offset while the local population typically used LMT. Given that Shanks was wrong so often everywhere else Portugal held sway, he's probably wrong here too.
# India -# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne: -# According to a Portuguese decree (1911-05-26) -# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf -# Portuguese India switched to UT +05 on 1912-01-01. +# From Tim Parenti (2024-03-XXX), per Paul Eggert (2014-08-11), after a +# heads-up from Stephen Colebourne: +# According to a Portuguese decree (1911-05-24), Portuguese India switched to +# UT +05 on 1912-01-01 (see Europe/Lisbon). #Zone Asia/Panaji [not enough info to complete]
Let's move this revised commentary to 'backzone' as it's unlikely we'll need to create an Asia/Panerji in the main data.

On Tue, 12 Mar 2024 at 20:38, Paul Eggert <eggert@cs.ucla.edu> wrote:
I ran into one problem right away: "make DATAFORM=vanguard check" failed, with messages like this:
./zic -d check_now.dir tzdata.zi "tzdata.zi", line 3483: Zone continuation line end time is not after end time of previous line "tzdata.zi", line 3484: input line of unknown type "tzdata.zi", line 3485: input line of unknown type "tzdata.zi", line 3486: input line of unknown type
so it looks like some of the ifdeffed-ish lines need to be changed, in the vanguard section.
At first inspection, it looks to me as though this may be some sort of bug with zishrink.awk. It is currently generating the following out-of-order lines for my draft Atlantic/Azores: Z Atlantic/Azores -1:42:40 - LMT 1884 -1:54:32 - HMT 1912 Ja 1 2u -2 p %z 1966 O 2 2s -1 p %z 1986 -1 - %z 1982 Mar 28 0s -1 E %z 1992 D 27 1s 0 E WE%sT 1993 Jun 17 1u -1 E %z …but, unless I'm missing something, the source lines for Atlantic/Azores seem to pretty clearly be in the right order in the 'europe' file. Could you look into possible sources of error there? (Note: I have already caught a "1992 Sep 27" that ought to be "1992 Dec 27", but the error remains.)
I suggest rephrasing this Africa/Cape_Verde comment to something like "For timestamps before independence see commentary for Europe/Lisbon." We don't need to mention Shanks any more since we're no longer relying on Shanks for any of this data.
Likewise for Africa/Bissau and Africa/Luanda.
For Africa/Bissau and Africa/Luanda, where Shanks mistakes the decree date for the transition date, I definitely agree; thanks. For Africa/Cape_Verde and Africa/Maputo, I think there is still some residual value in mentioning "Shanks said something different", since we aren't sure there wasn't some other law that could have introduced zonal time to any given colony prior to the May 1911 decree. But I can definitely aim to be more concise in doing so.
For Africa/Maputo, it seems that we should change the transition time to be the time you found, and ignore Shanks there as well. Although Wikipedia says Lourenço Marques (as Maputo was then called) starting in 1904 had a tram service starting, which presumably had a need for reliable fixed GMT offset, it's possible that the tram service used one GMT offset while the local population typically used LMT. Given that Shanks was wrong so often everywhere else Portugal held sway, he's probably wrong here too.
Do you mind if I quote/paraphrase that in the updated commentary?
# India
-# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne: -# According to a Portuguese decree (1911-05-26) -# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf -# Portuguese India switched to UT +05 on 1912-01-01. +# From Tim Parenti (2024-03-XXX), per Paul Eggert (2014-08-11), after a +# heads-up from Stephen Colebourne: +# According to a Portuguese decree (1911-05-24), Portuguese India switched to +# UT +05 on 1912-01-01 (see Europe/Lisbon). #Zone Asia/Panaji [not enough info to complete]
Let's move this revised commentary to 'backzone' as it's unlikely we'll need to create an Asia/Panerji in the main data.
The commented-out Asia/Panaji section is already in 'backzone'. Or did you mean something else? -- Tim Parenti

On 2024-03-12 20:12, Tim Parenti wrote:
At first inspection, it looks to me as though this may be some sort of bug with zishrink.awk.
Yes, as its comments say it's special-purpose code that works for the current tzdata but it's fragile. I installed the attached patch which should address this particular situation, but the code's still fragile as you can see.
For Africa/Cape_Verde and Africa/Maputo, I think there is still some residual value in mentioning "Shanks said something different", since we aren't sure there wasn't some other law that could have introduced zonal time to any given colony prior to the May 1911 decree. But I can definitely aim to be more concise in doing so.
Sounds good.
Do you mind if I quote/paraphrase that in the updated commentary?
No, that sounds good too.
The commented-out Asia/Panaji section is already in 'backzone'.
Oh, sorry, I didn't notice that. Please ignore that part of my earlier comment.

This recent glitches with %z-related lines in the Portugal data lead me to think that it's time to start using %z in the main format. For example, instead of this:
-2:00 Port -02/-01 1942 Apr 25 22:00s -2:00 Port +00 1942 Aug 15 22:00s -2:00 Port -02/-01 1943 Apr 17 22:00s -2:00 Port +00 1943 Aug 28 22:00s -2:00 Port -02/-01 1944 Apr 22 22:00s -2:00 Port +00 1944 Aug 26 22:00s -2:00 Port -02/-01 1945 Apr 21 22:00s -2:00 Port +00 1945 Aug 25 22:00s -2:00 Port -02/-01 1966 Apr 3 2:00 -1:00 Port -01/+00 1983 Sep 25 1:00s -1:00 W-Eur -01/+00 1992 Sep 27 1:00s
the 'europe' file should contain this:
-2:00 Port %z 1966 Apr 3 2:00 -1:00 Port %z 1983 Sep 25 1:00s -1:00 W-Eur %z 1992 Sep 27 1:00s
This would eventually simplify future maintenance and help avoid similar glitches in the future. It's reasonable to move %z to main format now, as zic has supported %z since release 2015f.

On 2024-03-18 00:16, Paul Eggert via tz wrote:
This recent glitches with %z-related lines in the Portugal data lead me to think that it's time to start using %z in the main format. For example, instead of this:
-2:00 Port -02/-01 1942 Apr 25 22:00s -2:00 Port +00 1942 Aug 15 22:00s -2:00 Port -02/-01 1943 Apr 17 22:00s -2:00 Port +00 1943 Aug 28 22:00s -2:00 Port -02/-01 1944 Apr 22 22:00s -2:00 Port +00 1944 Aug 26 22:00s -2:00 Port -02/-01 1945 Apr 21 22:00s -2:00 Port +00 1945 Aug 25 22:00s -2:00 Port -02/-01 1966 Apr 3 2:00 -1:00 Port -01/+00 1983 Sep 25 1:00s -1:00 W-Eur -01/+00 1992 Sep 27 1:00s
the 'europe' file should contain this:
-2:00 Port %z 1966 Apr 3 2:00 -1:00 Port %z 1983 Sep 25 1:00s -1:00 W-Eur %z 1992 Sep 27 1:00s
This would eventually simplify future maintenance and help avoid similar glitches in the future.
It's reasonable to move %z to main format now, as zic has supported %z since release 2015f.
Maybe announce that proposal in its own thread with a clear subject, so if there is any kerfuffle, it can be dealt with separately. Or maybe everyone might be happy with that for a nice change? ;^> -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry

My recent %z and Africa/Maputo changes overlap somewhat with your work-in-progress changes for Portugal and its former possessions. As penance I attempted to rebase those WIP changes; please see attached. This rebase also attempts to address further comments made last month. In particular: On 2024-03-12 20:12, Tim Parenti wrote:
For Africa/Bissau and Africa/Luanda, where Shanks mistakes the decree date for the transition date, I definitely agree; thanks.
For Africa/Cape_Verde and Africa/Maputo, I think there is still some residual value in mentioning "Shanks said something different", since we aren't sure there wasn't some other law that could have introduced zonal time to any given colony prior to the May 1911 decree.
I did some more research into Africa/Maputo and hope I resolved them in the Africa/Maputo change I installed earlier today. For the other items mentioned above, I adjusted the commentary in the attached, which I have not yet installed. Perhaps it'd be a good time to do a new release soon after this is installed, as that will give more warning to downstream users about the %z change to the main data, before there's anything but historical changes in the represented data.

Thank you for all the effort your made. Looks excellent. It was worth it to wait for your profound analysis. On 12.03.24 23:51, Tim Parenti wrote:
(was: error Portugal 1980)
On Thu, 29 Feb 2024 at 18:45, Alois Treindl via tz <tz@iana.org> wrote:
I have the impression that the document form the Lisbon astronomical observatory, which I linked in my first post, is quite reliable.
https://oal.ul.pt/hora-legal/legislacao-sobre-a-hora-legal/
Yes, I had gotten the same impression when I began my research on this in 2021, though I did find what appears to be at least one error in even the Observatory's data based on the laws I inspected.
It names the law numbers, which are easy to find here https://diariodarepublica.pt/dr/home
Of course, but there are over 50 referenced decrees and ordinances, and the Observatory's listing for continental Portugal didn't mention the islands when we already knew there was some divergence from the mainland in the 1980s. Hence the call for assistance earlier.
Thankfully, the Observatory has another page that lists the laws currently in force for the mainland and the islands: https://oal.ul.pt/hora-legal/legislacao/ Using those references, I was able to work backward through each law's revocations and abrogations to a clearer point, constructing a history for the islands. (Without those footholds, I would have had nowhere to even start.)
Attached is a draft patch summing up the results of this research for the Portuguese mainland, the islands, and some of its former overseas territories. It is not yet ready for merge, as it still needs a NEWS item and commit message which I'll work on shortly, but more importantly it needs review from the list. There are a few editorial/stylistic decisions I made, mostly to keep things simpler, that could be changed if there are compelling reasons… but it should mostly only need spot-checks for correctness, which hopefully the added commentary will help with.
The patch can also be reviewed (temporarily) on GitHub at: https://github.com/timparenti/tz-development/commit/0588a349673bfd5b4edadb3e...
-- Tim Parenti

I have resolved an implementation error which was present in the patch I originally drafted as well as Paul's later rebase. The resulting rebase is attached (0002) and has been pushed to the development repository alongside some minor administrative fixups (0001). As with the original draft patch, the updated patch attached extends the former 1947–1965 "spring forward" rule to Apr 1966, recharacterizing the period from 1966-04-03 through 1966-10-02 as DST prior to the enactment of year-round CET, since this more closely reflects how law entered into force. However, this left "Port" rules toggled into DST and so necessitates an explicit "fallback" rule upon resumption of seasonal time changes, which this version adds for Sep 1976. Thanks also to Paul for the work on ziguard.awk to help accommodate these changes. -- Tim Parenti
participants (4)
-
Alois Treindl
-
brian.inglis@systematicsw.ab.ca
-
Paul Eggert
-
Tim Parenti