Re: Standard for timezone handling with TZ
That's a bug in the Olson rules; they aren't compatible with Posix 1003.1-1990. Thanks for pointing it out. Here's a conservative patch to Olson's latest version which renames `GMT-4' to `GMT-0400' to avoid the bug.
Another possibility is simply to remove the GMT[-+]* rules, since their sign is the opposite of the sign in the Posix TZ string, and this is confusing.
My guess is it's best to keep some sort of GMT rules; as the etcetera file notes, # All of these are set up just so people can "zic -l" to a timezone # that's right for their area, even if it doesn't have a name or dst rules # (half hour zones are too much to bother with -- when someone asks!) and if you don't have the rules you can't do the "zic -l". (Whether there should be some mechanism to establish a rule-based rather than file-based time zone as local time is another question.)
*** etcetera 1992/04/23 17:34:35 7.1 --- etcetera 1994/02/10 19:49:45 7.1.1.1 *************** *** 6,55 ****
Zone GMT 0 - GMT
! Zone GMT-12 -12 - GMT-1200 ! Zone GMT-11 -11 - GMT-1100
Is it better to render these as, for example,
Zone GMT 0 - GMT
! Zone GMT+1200 -12 - GMT+1200 ! Zone GMT+1100 -11 - GMT+1100
Or, given Casper H. S. Dik's example... > SunOS 4: > % env TZ=GMT-4 date GMT-4 is a timezone file (Olson) > Thu Feb 10 04:29:42 GMT-0400 1994 > % env TZ=GMT-04 date But use POSIX rules here > Thu Feb 10 12:32:21 GMT 1994 ...does POSIX *require* that the above rules be written
Zone GMT 0 - GMT
! Zone GMT+1200 -12 - GMT ! Zone GMT+1100 -11 - GMT
(that is, without the "+1200" modifier to the zone name that will appear in user-visible output)? --ado
Don't have it handy, but my recollection is that 1003.1-1990 doesn't say diddly about the contents of time zone names. (This seems the right thing too; "GMT" is probably spelled with characters not on my keyboard in most places of the world.)
Date: Mon, 14 Feb 94 09:40:09 EST From: ado@elsie.nci.nih.gov (Arthur David Olson) ...does POSIX *require* that the above rules be written... without the "+1200" modifier to the zone name that will appear in user-visible output? No. Posix 1003.1-1990 section 8.1.1 page 153 lines 75-78 requires that the offset be one or two digits, no more and no less. So if you specify TZ='GMT+1200' you are outside the scope of the standard, and the implementation is free to do what it likes. However, it's confusing for TZ='GMT+12:00' to mean something entirely different from TZ='GMT+1200'. Posix says the former means ``we're 12 hours behind GMT and our time zone is named "GMT"''; my proposed change makes the latter mean ``we're 12 hours _ahead_ of GMT and our time zone is named "GMT+1200"''. The fundamental problem is that the user interface (Posix TZ strings) uses a different sign than the TZ package. Sorry, I don't offhand see a clean fix for this.
participants (3)
-
ado -
eggert@twinsun.com -
roland@gnu.ai.mit.edu