Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #196602 > unrolled thread

/etc/localtime and How it Works

Started by"Martin McCormick" <martin.m@suddenlink.net>
First post2018-06-12 19:40 +0200
Last post2018-06-12 20:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  /etc/localtime and How it Works "Martin McCormick" <martin.m@suddenlink.net> - 2018-06-12 19:40 +0200
    Re: /etc/localtime and How it Works Greg Wooledge <wooledg@eeg.ccf.org> - 2018-06-12 20:00 +0200
      Re: /etc/localtime and How it Works "Martin McCormick" <martin.m@suddenlink.net> - 2018-06-12 21:30 +0200
    Re: /etc/localtime and How it Works Dan Ritter <dsr@randomstring.org> - 2018-06-12 20:20 +0200

#196602 — /etc/localtime and How it Works

From"Martin McCormick" <martin.m@suddenlink.net>
Date2018-06-12 19:40 +0200
Subject/etc/localtime and How it Works
Message-ID<vZVqV-2ZF-3@gated-at.bofh.it>
After getting curious about what all is in /etc/localtime, I
found out that one can read the binary with zdump.  zdump -v
filename produces a number of lines that correspond to continuity
breaks such as the shift from standard time in Winter to Daylight
Saving Time or Summer Time.

	I happen to live in the Central United States so
/etc/localtime is a copy of /usr/share/zoneinfo/America/Chicago
and zdump -v of this file shows about 450 lines showing the start
and end of DST from 1901 through 2038 when we run out of bits in
the current 32-bit counter.

	One striking change is the switch to War Time that
started in February of 1942 and ended on August 14 of 1945 with
no modification of any kind between those two dates.

	Some parts of the country actually added two hours of
time shifting in Summer and then dropped back to 
War Time in the Winter.  The Chicago file shows a single hour of
time shift during War time.

	I looked at /usr/share/zoneinfo/America/New_York to see
what the Eastern Time Zone did and got a surprise.  Instead of
450 odd lines, there are only 4 which basically describe the
1901-2038 life span of the file.

	I was expecting America/New_York to look just like
America/Chicago except for the UTC offset and maybe some slightly
different dates back when DST was mostly used on the coasts and
not at all in much of the middle of the country.

	Oklahoma and Texas, for example, didn't use any time
shifting except for War Time until 1967 after passage of the
Uniform Time Standards Act and a decision by all the major
television networks of the day to no longer send delayed
broadcasts down their wires to affiliates in states that didn't
observe DST.

	So, my question is why is there such a difference between
the two files and how do people in the Eastern Time Zone
automatically learn of the two time shifts each year?

Martin McCormick

[toc] | [next] | [standalone]


#196603

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-06-12 20:00 +0200
Message-ID<vZVKh-35T-7@gated-at.bofh.it>
In reply to#196602
On Tue, Jun 12, 2018 at 12:38:05PM -0500, Martin McCormick wrote:
> 	I looked at /usr/share/zoneinfo/America/New_York to see
> what the Eastern Time Zone did and got a surprise.  Instead of
> 450 odd lines, there are only 4 which basically describe the
> 1901-2038 life span of the file.

wooledg:~$ zdump -v America/New_York | wc
   2324   37136  229862

[toc] | [prev] | [next] | [standalone]


#196605

From"Martin McCormick" <martin.m@suddenlink.net>
Date2018-06-12 21:30 +0200
Message-ID<vZX9n-41B-5@gated-at.bofh.it>
In reply to#196603
Greg Wooledge <wooledg@eeg.ccf.org> writes:
> wooledg:~$ zdump -v America/New_York | wc
>    2324   37136  229862

My mistake was that I used cd to get to
/usr/share/zoneinfo/America and then I did zdump -v New_York and
it didn't complain at all but printed out just the 4 lines that
made me think it was processing the file.  It's not but this is
probably a lead-in and lead-out that brackets the interpretation
of the binary data in the file.

	giving zdump the America/New_York path produced output
that does, in fact, look just like America/Chicago except for the
things one would expect to be different such as the UTC offsets.

also, another poster mentioned about the information being based
on political decisions.  A perfect example just occurred in the
last few weeks in which the DPRK and ROK agreed to use the same
time zone again.  The difference had been 1800 seconds or 30
minutes.

	Thanks.

Martin McCormick

[toc] | [prev] | [next] | [standalone]


#196604

FromDan Ritter <dsr@randomstring.org>
Date2018-06-12 20:20 +0200
Message-ID<vZW3D-3rl-1@gated-at.bofh.it>
In reply to#196602
On Tue, Jun 12, 2018 at 12:38:05PM -0500, Martin McCormick wrote:
> 	I was expecting America/New_York to look just like
> America/Chicago except for the UTC offset and maybe some slightly
> different dates back when DST was mostly used on the coasts and
> not at all in much of the middle of the country.
> 
> 	Oklahoma and Texas, for example, didn't use any time
> shifting except for War Time until 1967 after passage of the
> Uniform Time Standards Act and a decision by all the major
> television networks of the day to no longer send delayed
> broadcasts down their wires to affiliates in states that didn't
> observe DST.
> 
> 	So, my question is why is there such a difference between
> the two files and how do people in the Eastern Time Zone
> automatically learn of the two time shifts each year?

You have just stepped into a minefield. It's a really
interesting one, though.

First: the compilation of timezone data is the Olson Database,
after the original editor. The current editor is Paul Eggert,
and the America/New_York style nomenclature is his fault.

https://www.iana.org/time-zones
https://en.wikipedia.org/wiki/Tz_database

Second: every decision recorded in the Olson Database is a
political decision. Science and engineering don't really 
enter into it much.

In many countries, the national government sets the standard,
and that's that. In the USA, the federal government sets the
dates for changing from standard to daylight saving time and
back, but does not mandate adoption of DST or any specific 
timezone.

You'd think that at least each state would be consistent
internally, but that's not necessarily the case either. 

https://en.wikipedia.org/wiki/Eastern_Time_Zone

So, to answer your question: laws are passed and the information
published in the same way that other laws are published, plus
newspapers and TV news and so forth tend to be vocal about the
issue. And Eggert learns about it and puts it in the database,
and then everybody makes changes to their copies of tz.

-dsr-

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web