timezone implementation constraints

Moderator, John Quarterman std-unix at ut-sally.UUCP
Sat Jul 26 01:20:14 AEST 1986


From: hplabs!hao!vianet!devine at pyramid.UUCP (Bob Devine)
Date: Thu, 24 Jul 86 23:13:44 mdt

[ This is really not directly related to IEEE 1003.1, since
it solely discusses the details of an *implementation* and
says nothing about the *interface*.  However, it does
address something which has been previously discussed
in this newsgroup, and I can't think of a better place for it.
However, please do detailed line-by-line discussions of this
through mail among interested parties.

Could we find a new topic?
-mod]

  Arthur Olson's recent posting to mod.sources included the updated
settz data tables.  This reply in mod.std.unix is to correct some
of the entries in the table and re-raise my points about what is the
best implementation.  I believe everyone has agreed on Robert Elz's
direction for the POSIX document wording.

  The lines beginning with "> " are from Arthur Olson.

> Bob Devine has written that ". . .your table is wrong for MostNA in 1974.
> The correct ending date is 10/27 not 11/24."  Yet on a 4.1bsd VAX/11-750
> system, compiling and executing the program
> [[[ program omitted ]]]
> results in the output
>	Fri Nov  1 22:40:00 1974
>	isdst: 1
> For now we'll stay with 4.1bsd's version.

  The date I gave is correct.  Any version of Unix that uses 11/24 is
simply wrong.  The dates for 1974 and 1975 DST rules are:
      1974   1/6  to 10/27
      1975   2/28 to 10/26
  Even the source for Xenix V that I just checked has it wrong.  Believe
me folks, this comes directly from Dept of Transportation.  (If you are
wondering why DOT has responsibility for such info, drop me a line. BD)

> Note also this from munnari!kre:
> "I recall also being told by someone once that Canada didn't have
> the DST variations in 74/75 that the US did, but I am not nearly
> sure enough of this to add anything."
> If Canada or Mexico decide not to follow the US change in DST that takes
> effect in 1987, additions had best be made below.

Canada did not follow the fuel follies for '4 and '5.
Please split the rules *by country*, not by continent, to avoid such problems.
The "MostNA" rules listed are incorrect for Canada and Mexico!

> Before the Uniform Time Act of 1966 took effect in 1967, observance of
> Daylight Saving Time in the US was by local option, except during wartime.

  This is the acid-test of all proposals for handling DST rules.  When I
submitted my suggestion to mod.std-unix last February (that now seems like
the distant past), I used the most common way of representing the changes.
The reason was I had examined all the world-wide rules and after silently
tearing my hair out trying to come up with a small table, decided to
go with the only way that I had any hope of getting right.  To represent
all of the worldwide rules for just +/- 5 years requires several hundred
lines.  No speed would ever be possible for a full table.  My way was to
just represent the current year.  At best, that simple formula would work
for many years; at worst, changes can't be handled (which is why folks
did fall in love with it).

  The US tried to standardize DST rules in that '66 Act.  But, of course,
there are still many exceptions.  Plus, checking dates prior to it is
painful.  Now imagine how the US was before 1967 and apply that to the
world.  You get the feeling of near chaos?

  I have since come to the conclusion that the best way to represent
DST and timezone information is a single rule plus an "exceptions database".
Only if the simple rule doesn't work (e.g., past or future years, other
timezones) is the database used.  This way, rules can be added as needed.
Or the entire database can be empty with the single rule used for all
conversions.

  DST is almost like the (jeez, I forgot who said it) quote about the
universe "being more complicated that can be possibly imagined".
This is not an exact analogy, but, at least physical laws are controlled
by Congress!


># Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
>Rule	MostNA	1967	1973	-	Apr	lastSun	2:00	1:00	D
>Rule	MostNA	1967	1973	-	Oct	lastSun	2:00	0	S

Note: the rules for 1967 - 1973 depend on what state/territory you are in.
For example, Michigan is an exception to the rule for 1969-72 but not for
1967-68.  Eastern Indiana is another tricky one for this period.  Again,
note that this is *after* the '66 Act that tried to standardize DST.

>Rule	MostNA	1974	only	-	Jan	6	2:00	1:00	D
>Rule	MostNA	1974	only	-	Nov	24	2:00	0	S

Should be ====>                         Oct     27

># New names
>Zone	Newfoundland	-3:30	-	NST	# Is DST now observed here?
						># If so, when did it start?

Newfoundland observes DST by the same rules as the rest of Canada -- the
last Sunday in April to the last Sunday in October.  It has followed this
pattern since 1951.  Changeover time is 2am.

Saskatchewan is another matter...part in EST; part in CST which doesn't use DST.

># Nonstandard mainland areas:

These rules are impossible to formulate.  The amazing variety of
different DST rules makes such a tabularizing absurd.  The rules vary
by state, by regions within states, by areas that have not yet even
been admitted to the union, by county, by city, and seemingly by whim.

>Rule	SomeUS	1918	1919	-	Mar	lastSun	2:00	1:00	D
>Rule	SomeUS	1918	1919	-	Oct	lastSun	2:00	0	S
>Rule	SomeUS	1942	only	-	Feb	9	2:00	1:00	W # War
>Rule	SomeUS	1945	only	-	Sep	30	2:00	0	S
>
>Zone	East-Indiana	-5:00	SomeUS	E%sT # Usually standard near South Bend
>Zone	Arizona		-7:00	SomeUS	M%sT # Usually standard in Arizona
>
># And then there's Hawaii.
>Rule	Hawaii	1947	only	-	Jun	8	2:00	0	S

The information I have does not show any DST changes in 1947.  DST was
not observed in the period 1946-present.

Bob Devine

Volume-Number: Volume 6, Number 37



More information about the Mod.std.unix mailing list