🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #69

Re: diffs for ctime.c for new DST rules, v7 systems

#69
From: guy
Date: Tue, 17 Feb 1987 19:44
35 lines
2534 bytes
>I always thought the whole idea of the BSD way of determining the dst was
>extermely redundant

Try "The V7 way of determining..."; putting it into the kernel
antedates 4.2BSD.

>in contrast to the sysV method, in which anyone can choose whether to have
>it or not any time, in run time, per process run; on BSD systems it's a big
>and ugly routine, compiled into every utility,

Whereas on System V, it's *still* a big and ugly routine, compiled
into every utility - or, more to the point, it's a big and ugly
*table*, compiled into every utility, in most UNIX systems out there.
At least Berkeley made an attempt to put tables for areas other than
the US into those utilities (even though there were a number of
errors in the tables).

There *is* a solution; Arthur Olson came up with a version of "ctime"
and friends that reads the DST rules out of a *file*, which is where
they should have been in the first place.  If the rules change, you
just edit a file and compile it into a table; any programs run after
that point will have the correct rules.

The file to be read is selected by the TZ environment variable, so a
user *can* override the default setting if they want.  A program can
also *ignore* the value of TZ; this is required by programs such as
"uucico" that must know the time zone the phone lines are in, *not*
the time zone the user is in.  You can even arrange to give the files
names like EST5EDT, so that you can set TZ to values that will work
with binaries built on systems that don't have this new stuff;
solutions I've seen proposed that encode the rules in the TZ
environment string don't have this property, so they break binary
compatibility (not to mention breaking programs that expect to
convert dates not in the current year - remember, "last year" is, at
certain times, less than one day ago!).
Technical Details
Message-ID: <13490@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!genrad!decvax!decwrl!sun!gorodish!guy
References: <1565@lsuc.UUCP> <1151@ukecc.uky.csnet> <1569@lsuc.UUCP> <13253@sun.uucp> <693@instable.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!genrad!decvax!decwrl!sun!gorodish!guy
From: guy@gorodish.UUCP
Newsgroups: comp.bugs.misc
Subject: Re: diffs for ctime.c for new DST rules, v7 systems
Message-ID: <13490@sun.uucp>
Date: Tue, 17-Feb-87 14:44:21 EST
Article-I.D.: sun.13490
Posted: Tue Feb 17 14:44:21 1987
Date-Received: Thu, 19-Feb-87 06:15:24 EST
References: <1565@lsuc.UUCP> <1151@ukecc.uky.csnet> <1569@lsuc.UUCP> <13253@sun.uucp> <693@instable.UUCP>
Sender: news@sun.uucp
Reply-To: guy@sun.UUCP (Guy Harris)
Distribution: world
Organization: Sun Microsystems, Mountain View
Lines: 35