POSE proposal for TZ

Moderator, John Quarterman std-unix at ut-sally.UUCP
Wed Feb 26 14:02:15 AEST 1986


From: Jack Jansen <seismo!mcvax!jack>
Date: 25 Feb 86 20:56:12 N (Tue)
Organization: AMOEBA project, CWI, Amsterdam

Well, even though the discussion doesn't seem to have anything
to do with standardising, it *is* interesting.

[ Comments on how to handle timezones are explicitly requested
in an appendix of the current P1003 draft.  -mod ]

I like the outside of elsie!ado's proposal, but I think the
implementation could be done more simple and cheap.

First (not too important), if you go for binary files, you
shouldn't put two arrays of fixed size in the beginning.
This will inevitably mean trouble for future generation. If you
*do* insist on binary data, make it variable sized array, and
put a count in.

Second, and most important, I think the method is far too complex
for its achievements. I think something along the following
lines would work as easy, and be much simpler to set up:
- view normal time and dst as *different* timezones. If a certain
  area has had more than one dst offset since written history(jan70),
  see those as different too. Note that different timezones could
  have the same name.
- Per timezone, keep a list with transition-times, and new timezones.
- Further, use a scheme along the lines of elsie!ado's proposal, so
  use files in a specified directory, and use a link to get the
  local default time.
Now, two typical files would look like:
/etc/tz/FOT:
    # FOT - Far Out Time.
    FOT	+11:28		# Offset from GMT
    Apr 1, 1970	FST
    Apr 1, 1971	FST
    Apr 1, 1972	FST.1972
    ...
/etc/tz/FST:
    # FST - Far out Summer Time.
    # Differs by 1:10 hour from FST.
    FST	+12:38
    Sep 1, 1970	FOT
    ...
/etc/tz/FST.1972:
    # FST.2 - Far out Summer Time exceptional situation for 1972.
    # Differs 1:11 hour from FOT.
    FST	+12:39
    Sep 1, 1972	FOT
Note that these files should be in binary, of course, and transition
times in order of ascending magnitude.
Also, if you do a settz("FST"), and present a date in november,
a quick binary search will immedeately get you to the Sep 1 transition,
and get you to the right timezone. Note that this will *also* work for
timezones with the same names: the name in col. 2 of the files, and in
the settz() call, are filenames, and the first entry in the file is
the name that will be used on output.

--
	Jack Jansen, jack at mcvax.UUCP
	The shell is my oyster.

Volume-Number: Volume 5, Number 61



More information about the Mod.std.unix mailing list