Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!sun!guy From: guy@sun.UUCP Newsgroups: comp.unix.questions Subject: Re: How is the time zone set in 4.2 BSD? Message-ID: <21069@sun.uucp> Date: Sun, 14-Jun-87 18:01:49 EDT Article-I.D.: sun.21069 Posted: Sun Jun 14 18:01:49 1987 Date-Received: Mon, 15-Jun-87 05:48:26 EDT References: <770@thumper.UUCP> <625@pdp.cs.OHIOU.EDU> <198@pvab.UUCP> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 62 Keywords: daylight savings time > >The dst indicates that you use daylight savings time, and a number > ^^^^^^^^ > >following it (optional) indicates when the switch occurs. > ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > How should this number be expressed? And when does the switch occur > if I leave it out? > > I have a Sun, and I can't find any reference to this in the manuals (we're > running SunOS 2.0) even though I've seen others using this. This number should be the numerical value of one of the DST_ defined constants in "/usr/include/sys/time.h". This set may differ depending on what OS you're running; 4.3BSD added some, and those appeared in SunOS in release 3.2. None of this was well documented in the 4BSD manuals, and I think we unfortunately continued in this UNIX tradition. (A future release will fix this - and will fix other problems by using the Arthur Olson time zone code.) Those values are: #define DST_NONE 0 /* not on dst */ #define DST_USA 1 /* USA style dst */ #define DST_AUST 2 /* Australian style dst */ #define DST_WET 3 /* Western European dst */ #define DST_MET 4 /* Middle European dst */ #define DST_EET 5 /* Eastern European dst */ All of the above were supported in 4.2BSD and in all versions of SunOS. Unfortunately, the tables for all but DST_USA were wrong in various ways; the USA table also doesn't include the new DST rules. #define DST_CAN 6 /* Canada */ This was added in 4.3BSD and SunOS 3.2; it's the same as the US, except that no special switching occurred in 1974 and 1975. In SunOS 3.2, the USA rules, but not the Canadian rules, were changed to include the new DST rules. #define DST_GB 7 /* Great Britain and Eire */ #define DST_RUM 8 /* Rumania */ #define DST_TUR 9 /* Turkey */ #define DST_AUSTALT 10 /* Australian style with shift in 1986 */ These were added in SunOS 3.2. SunOS 3.2 also fixed some of the tables - the European (continental and UK) tables match what somebody told me some German government agency reported were the correct switching dates in recent years (1986 on). The Australian rules were still not quite right, and the Canadian rules did not include the new DST changes. SunOS 3.4 fixed those problems, and the versions of the tables provided with SunOS 3.4 were also used to generate the versions of the tables sent out in one of the official bug fixes to 4.3BSD. (They also match the timezone table files provided with the most recent version of Arthur Olson's code.) If the number is not specified, it defaults to 1, or DST_USA. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)