This posting contains diffs for 4 popular versions of "date.c"
to enable it to work correctly with Arthur Olson's posted
modifications to localtime().  (in mod.sources, in March 86).

Almost no programs need to be modified to use that localtime,
however "date" is one of those that do (as it "knew" that daylight
saving means 1 hour added on, and nothing else, and it used a
rather crude mechanism to correct for the local timezone when
setting the date).

There are 3 changes of substance (and a few minor cleanups).

1) If the TZ environment variable is set to something that doesn't
make sense, prevent the date from being set (its likely to end up
being not quite what was intended).

2) Correct the time given properly, where its given in local time
(in Sys V date there's no alternative).  Handle all variations of
daylight saving, etc, that Arthur Olson's localtime can handle,
and that's practically everything.

3) Print the time-zone name that the new localtime returns (in
the global tz_abbr), rather than using the old ways of obtaining
timezone names.

Assumption: before these diffs will be useful, you must have installed
the new localtime() in libc.  To do that you have to merge your
current libc/ctime.c with the new one, changing the name of
newlocaltime() to localtime() as you do it.  This is not particularly
difficult.  You should compile it so that TZDIR is /etc/tzdir.

Procedure: Select one of the following 4 diffs files.  If you are
a BSD 4.2 4.3 beta or 4.3 site take diffs.4.2, diffs.4.3beta, or
diffs.4.3 respectively.  AT&T system sites should take diffs.SysV.
V7 and BSD4.1 are on their own, sorry.  If you look at all four diffs
files you will see how similar they are, you shouldn't find it difficult
to install in any other version of date.  In particular, the major piece
of code is identical (modulo indentation) in all of these versions.

Then use "patch" to apply the diffs as

	cp /..../date.c .
	chmod +w date.c
	patch date.c < diffs.XXX

Then check what was produced, make sure that it all makes sense.
Compile & install the modified "date".

Robert Elz		kre%munnari.oz@seismo.css.gov
			seismo!munnari!kre
