[tz] incorrect timezone info from tar files

Guy Harris guy at alum.mit.edu
Sun Dec 8 03:44:44 UTC 2019

On Dec 6, 2019, at 1:23 PM, Benjamin Weiser <Benjamin.Weiser at inrix.com> wrote:

> Do you mind explaining how you would parse America/Sao_Paulo?

Zone America/Sao_Paulo            -3:06:28   -          LMT       1914
                                  -3:00      Brazil     -03/-02   1963 Oct 23  0:00
                                  -3:00      1:00       -02       1964
                                  -3:00      Brazil     -03/-02

This says:

	Until 1914, America/Sao_Paulo is 3 hours, 6 minutes, and 28 seconds behind GMT, I guess - that's local mean time, "LMT", and labeled as such;

	from 1914 to 1963-10-23, it follows the "Brazil" rules for summer/daylight saving time, with it being 3 hours behind GMT/UTC when summer time is not in effect and 2 hours behind GMT/UTC when summer time is in effect;

	from 1963-10-23 to 1964-01-01, its time is 1 hour ahead of standard time, i.e. 2 hours behind GMT/UTC;

	from 1964-01-01 on, it again follows the "Brazil" rules.

I mentioned the way to interpret the "Brazil" rules in a previous email.

Also read Robert Elz's more detailed explanation.

> I see the note acknowledging Daylight Savings was scrapped, but not sure how you are getting that value correctly.

From that last line *and* from the "Brazil" rules.
> We are using a JODA library, and my understanding is it finds the timezone under the ‘Zone’ section, such as America/Sao_Paulo, and finds the bottom most value for the most current timezone.

Presumably Joda-Time can process dates and times other than "right now", which means that it does *not* necessarily find the bottommost value, because that value might not be the one that applies - if it's 1963-11-27, for example, the *previous* line:

                                  -3:00      1:00       -02       1964

If a line that has a name, rather than a number, in the second field applies, it would also have to look at the "Rules" section and find the appropriate one of the "Brazil" entries there.

(Or maybe it does processing similar to zic, reading the entire file and building a table of transition timestamps and UTC offsets - or just reads compiled zic files.)

> For America/Sao_Paulo it says:
> -3:00      Brazil     -03/-02
> Are we not looking in the correct place?  In the ‘Rule’ section I don’t see anything that would give me -3:00 without DST.

See my earlier email about the "Rules" section.

More information about the tz mailing list