Newsgroups: comp.unix.misc,comp.std.internat,comp.lang.c,comp.unix.admin Path: sparky!uunet!cs.utexas.edu!usc!snorkelwacker.mit.edu! thunder.mcrcim.mcgill.edu!sobeco!seanm From: se...@sobeco.com (s.macguire) Subject: Daylight Savings time in the UK Organization: Sobeco Ernst & Young Date: Sun, 21 Jun 92 22:01:04 GMT Message-ID: <1992Jun21.220104.10582@sobeco.com> Keywords: daylight time localtime Lines: 16 The problem is simple. It takes an act of parliament to change the time from GMT to BST (British Summer time). Needless to say localtime() is firmly stuck in the North American way. Thus, many computers in the UK are fudged by hand for the week or so that the US and UK are out of sync. Have there been any changes to localtime(), or the TZ environment variable to cope with this mess; I've seen some horrible things done to the TZ variable in Brussels (lots of semicolons and numbers afterwards), but wondered if there was any proper standard. Thanks in advance. ___ Sean MacGuire uunet!sobeco!sean The MacLawran Group Inc, Montreal (514) 982-9688 "No insurance, no surrender"
Path: sparky!uunet!auspex-gw!guy From: g...@Auspex.COM (Guy Harris) Newsgroups: comp.unix.misc,comp.std.internat,comp.lang.c,comp.unix.admin Subject: Re: Daylight Savings time in the UK Keywords: daylight time localtime Message-ID: <13205@auspex-gw.auspex.com> Date: 21 Jun 92 23:28:18 GMT References: <1992Jun21.220104.10582@sobeco.com> Sender: n...@auspex-gw.auspex.com Followup-To: comp.unix.misc Organization: Auspex Systems, Santa Clara Lines: 43 Nntp-Posting-Host: auspex.auspex.com [Followups redirected to "comp.unix.misc"; it's not a C-language issue, as different C language implementations handle time zones differently, if they handle it at all. "C: it's not just for UNIX any more!"] >The problem is simple. It takes an act of parliament to change the time >from GMT to BST (British Summer time). Needless to say localtime() is >firmly stuck in the North American way. True on some systems. False on others. The UNIX system on which I'm typing this has the Arthur Olson time zone code, so it supports plenty of different time zones, and new ones can be added or old ones can be changed easily. >Have there been any changes to localtime(), or the TZ environment variable >to cope with this mess; I've seen some horrible things done to the TZ >variable in Brussels (lots of semicolons and numbers afterwards), but >wondered if there was any proper standard. Unfortunately, the horrible syntax you saw is probably the one specified by POSIX 1003.1 as a standard; while it's a "proper standard" in the sense of being part of an Official Standard (POSIX 1003.1, which may even be an ISO standard at this point), it's not a particularly proper scheme for dealing with multiple time zones, given the horrible syntax. Fortunately, POSIX 1003.1 leaves room to implement both the crufty POSIX scheme and the nice Arthur Olson scheme in the same system; in the POSIX scheme, you'd have to construct some string of the sort you saw, but in the Arthur Olson scheme, setting TZ to "GB-Eire" is sufficient, and to change the rules to match what the Act of Parliament in question specifies, you edit a text file and "recompile" it with the "zic" command. Many UNIX systems these days have either a scheme like the POSIX one (SVR3.1 and later have a scheme of that sort, although it only lets you specify the start and end date for the current year; systems with the full POSIX scheme let you specify a rule for the start and end date *as long as it's sufficiently regular* - unfortunately, in many countries it *isn't* sufficiently regular) or the Arthur Olson one or both. (SunOS 4.x has the Olson scheme, and both in SunOS 4.1[.x]; SVR4 has both, although not all SVR4 implementations necessarily come with the files the Olson code requires - they may be supplied in the source you buy from USL, but binary distributions might not have them; other systems also have one or the other or both.)
Path: sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!rwc.urc.tue.nl!tgcpwd From: tgc...@rwc.urc.tue.nl (Wim van Dorst) Newsgroups: comp.unix.misc Subject: Re: Daylight Savings time in the UK Keywords: daylight time localtime Message-ID: <4480@tuegate.tue.nl> Date: 22 Jun 92 06:59:29 GMT References: <1992Jun21.220104.10582@sobeco.com> <13205@auspex-gw.auspex.com> Sender: r...@tuegate.tue.nl Reply-To: tgc...@urc.tue.nl Organization: Eindhoven University of Technology, The Netherlands Lines: 20 In article <13...@auspex-gw.auspex.com> g...@Auspex.COM (Guy Harris) writes: >Fortunately, POSIX 1003.1 leaves room to implement both the crufty POSIX >scheme and the nice Arthur Olson scheme in the same system; in the POSIX >scheme, you'd have to construct some string of the sort you saw, but in >the Arthur Olson scheme, setting TZ to "GB-Eire" is sufficient, What is the Olson scheme/code? I know about the Posix standard as I implemented it on my system my self, but I haven't heard of the Olson TZ standard. Is it publicized somewhere? Is the source available? Is documentation available (The P1003.1 book is very clear on TZ IMHO)? When you could please elaborate a bit on the Olson Scheme, I (and perhaps others) would be most obliged. Met vriendelijke groeten, Wim `Blue Baron' van Dorst -- --------------------------------------------------------------------- Blue Baron = Wim van Dorst, Voice (+31) 074-443937, (+31) 02152-42319 (-: ba...@wiesje.hobby.nl tgc...@urc.tue.nl :-) ---------------------------------------------------------------------
Newsgroups: comp.unix.misc Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!usc! ucla-cs!twinsun!eggert From: egg...@bi.twinsun.com (Paul Eggert) Subject: Re: Daylight Savings time in the UK Message-ID: <bi7Mq3GV@twinsun.com> Keywords: daylight time localtime Sender: use...@twinsun.com Nntp-Posting-Host: bi Organization: Twin Sun, Inc References: <1992Jun21.220104.10582@sobeco.com> <13205@auspex-gw.auspex.com> <4480@tuegate.tue.nl> Date: Mon, 22 Jun 1992 20:06:34 GMT Lines: 97 tgc...@rwc.urc.tue.nl (Wim van Dorst) asks ``What is the Olson scheme/code?'' The Olson method is referred to in the Posix standard (see Posix 1003.1-1990 section B.8.1.1). It's an excellent package, and is becoming the standard in modern Unix systems. It uses the TZ environment variable as an index into a table on disk that contains rules that are sensitive to the year to which they are applied. The table is compiled from a human-readable text file. The package can handle a wide variety of time zone anomalies, including double-daylight, leap seconds, different rules for different years, and so forth. If your government changes your timekeeping rules, all you need to do is write up the new rules, run the `zic' program on them, and your programs can use the new rules without recompilation or relinking. You can FTP the Olson code from elsie.nci.nih.gov in pub/tz92.tar.Z. To give you a feeling of what the Olson format rules look like, (and how much politics influences timekeeping!), here are the rules for TZ=GB-Eire as published in tz92. # [British Summer Time] is fixed annually by Act of Parliament. # If you can predict what Parliament will do, you should be in # politics making a fortune, not computing. # Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] Zone GB-Eire 0:00 GB-Eire %s 1968 Oct 27 1:00s 1:00 - BST 1971 Oct 31 1:00s 0:00 GB-Eire %s # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # 1916 to 1925--irregular Rule GB-Eire 1916 only - Mar 21 1:00s 1:00 BST Rule GB-Eire 1916 only - Oct 1 1:00s 0 GMT Rule GB-Eire 1917 only - Apr 8 1:00s 1:00 BST Rule GB-Eire 1917 only - Sep 17 1:00s 0 GMT Rule GB-Eire 1918 only - Mar 24 1:00s 1:00 BST Rule GB-Eire 1918 only - Sep 30 1:00s 0 GMT Rule GB-Eire 1919 only - Mar 30 1:00s 1:00 BST Rule GB-Eire 1919 only - Sep 29 1:00s 0 GMT Rule GB-Eire 1920 only - Mar 28 1:00s 1:00 BST Rule GB-Eire 1920 only - Oct 25 1:00s 0 GMT Rule GB-Eire 1921 only - Apr 3 1:00s 1:00 BST Rule GB-Eire 1921 only - Oct 3 1:00s 0 GMT Rule GB-Eire 1922 only - Mar 26 1:00s 1:00 BST Rule GB-Eire 1922 only - Oct 8 1:00s 0 GMT Rule GB-Eire 1923 only - Apr 22 1:00s 1:00 BST Rule GB-Eire 1923 only - Oct 16 1:00s 0 GMT Rule GB-Eire 1924 only - Apr 30 1:00s 1:00 BST Rule GB-Eire 1924 only - Sep 21 1:00s 0 GMT # 1925 to 1939 start--regular Rule GB-Eire 1925 1939 - Apr Sun>=15 1:00s 1:00 BST Rule GB-Eire 1925 1938 - Oct Sun>=1 1:00s 0 GMT # 1939 end to 1947--irregular, and with double summer time Rule GB-Eire 1939 only - Nov 19 1:00s 0 GMT Rule GB-Eire 1940 only - Feb 25 1:00s 1:00 BST Rule GB-Eire 1941 only - May 4 1:00s 2:00 DST Rule GB-Eire 1941 only - Aug 10 1:00s 1:00 BST Rule GB-Eire 1942 only - Apr 5 1:00s 2:00 DST Rule GB-Eire 1942 only - Aug 9 1:00s 1:00 BST Rule GB-Eire 1943 only - Apr 4 1:00s 2:00 DST Rule GB-Eire 1943 only - Aug 15 1:00s 1:00 BST Rule GB-Eire 1944 only - Apr 2 1:00s 2:00 DST Rule GB-Eire 1944 only - Sep 17 1:00s 1:00 BST # Double daylight starts on a Monday in 1945? Rule GB-Eire 1945 only - Apr 2 1:00s 2:00 DST Rule GB-Eire 1945 only - Jul 15 1:00s 1:00 BST Rule GB-Eire 1945 only - Oct 7 1:00s 0 GMT Rule GB-Eire 1946 only - Apr 14 1:00s 1:00 BST Rule GB-Eire 1946 only - Oct 6 1:00s 0 GMT Rule GB-Eire 1947 only - Mar 16 1:00s 1:00 BST Rule GB-Eire 1947 only - Apr 13 1:00s 2:00 DST Rule GB-Eire 1947 only - Aug 10 1:00s 1:00 BST Rule GB-Eire 1947 only - Nov 2 1:00s 0 GMT # So much for double saving time. 1948 and 1949, irregular. Rule GB-Eire 1948 only - Mar 14 1:00s 1:00 BST Rule GB-Eire 1948 only - Oct 31 1:00s 0 GMT Rule GB-Eire 1949 only - Apr 3 1:00s 1:00 BST Rule GB-Eire 1949 only - Oct 30 1:00s 0 GMT # 1950 through start of 1953, regular. Rule GB-Eire 1950 1953 - Apr Sun>=14 1:00s 1:00 BST Rule GB-Eire 1950 1952 - Oct Sun>=21 1:00s 0 GMT # 1954 to 1980, starting rules Rule GB-Eire 1954 only - Apr 11 1:00s 1:00 BST Rule GB-Eire 1955 1959 - Apr Sun>=14 1:00s 1:00 BST Rule GB-Eire 1960 only - Apr 10 1:00s 1:00 BST Rule GB-Eire 1961 1963 - Mar lastSun 1:00s 1:00 BST Rule GB-Eire 1964 1967 - Mar Sun>=19 1:00s 1:00 BST Rule GB-Eire 1968 only - Feb 18 1:00s 1:00 BST Rule GB-Eire 1972 1980 - Mar Sun>=16 1:00s 1:00 BST # 1953 to 1971, ending rules Rule GB-Eire 1953 1960 - Oct Sun>=1 1:00s 0 GMT Rule GB-Eire 1961 1967 - Oct Sun>=23 1:00s 0 GMT Rule GB-Eire 1971 only - Oct 31 1:00s 0 GMT # Current rules Rule GB-Eire 1981 max - Mar lastSun 1:00s 1:00 BST Rule GB-Eire 1972 max - Oct Sun>=23 1:00s 0 GMT