Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!think!ames!ucbcad!ucbvax!decvax!decwrl!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.unix.wizards Subject: Re: Yet Another Solution to the ctime problem Message-ID: <16185@sun.uucp> Date: Sun, 5-Apr-87 07:19:37 EST Article-I.D.: sun.16185 Posted: Sun Apr 5 07:19:37 1987 Date-Received: Sun, 5-Apr-87 22:37:37 EST References: <6686@brl-adm.ARPA> Sender: news@sun.uucp Reply-To: guy@sun.UUCP (Guy Harris) Organization: Sun Microsystems, Mountain View Lines: 51 >A better solution (for temporarily fixing the problem until the next >release), at least on System V systems, has been suggest by AT&T for >binary sites: change the TZ environment variable from, for example, >TZ=PST8PDT to TZ=PDT7. Using the short form of TZ tells ctime() that >it should ignore its own daylight savings rules. Changing the number >from 8 to 7 and using PDT in the first field will then simulate being >on year round daylight savings time. Since most users don't set TZ >in their .profile/.cshrc/.whatever, changing the default TZ and rebooting >will be enough to get it into everyone's environment. This assumes, of course, that you *have* some way of setting the default TZ - i.e., "init" had better put TZ in its environment, or you had better have some other way of ensuring that *every* process on the system gets it stuck in its environment by default. "/etc/profile" just doesn't cut it, since a user may not have the Bourne or Korn shell as their login shell (and no, I'm not just talking about the C shell; some site may use some special application as a login shell for some users). >Even so, it is a lot better than putting the timezone in the kernel, as >with BSD. Or V7, which is the AT&T release where the timezone-in-the-kernel idea first appeared publicly. >I haven't seen Arthur Olson's code, but it would be a good idea for it to >accept an environment variable which specifies an alternate name for the >file with the DST data. It's such a good idea that Arthur Olson put it in when he first implemented it. >It would also be good for it to recognise Sys V's "TZ" to override the >kernel's idea of timezone. In fact, the name of the environment variable in question is "TZ". The files can be given names like EST5EDT if you want. It doesn't parse TZ, it just uses it as a file name; if you want to use some zone not in the tables supplied with the code, you have to edit the table source and recompile the tables, providing a name for the new zone. Olson's code permits timezones to be any number of minutes away from GMT, and permits you to specify pretty arbitrary DST rules. The file whose name is specified by TZ gives, in effect, both the DST rules and the offset from GMT. (Actually, it gives a list of transition times and, for each time, the GMT offset and time zone abbreviation valid starting at that transition time.) It doesn't bother with the kernel's idea of time zone at all, so there's nothing to override.