Re: Standard for timezone handling with TZ
Attached is my current best effort at dealing with "GMT" files in the time zone package. I'd very much welcome any feedback. --ado # @(#)etcetera 7.2 # 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!) Zone GMT 0 - GMT Link GMT UTC Link GMT UCT Link GMT Universal Link GMT Greenwich Link GMT Zulu Link GMT GMT-0 Link GMT GMT+0 Link GMT GMT0 # We use POSIX-style signedness in the names and output, # internal-style signedness in the specifications. # These are shoved down into an "Etc" directory so we get a name change-- # in earlier incarnations, we had lines such as # Zone GMT-12 -12 - GMT-1200 # and do not want things to change quietly if someone accustomed to the old # way does a # zic -l GMT-12 Zone Etc/GMT-12 12 - GMT-12 Zone Etc/GMT-11 11 - GMT-11 Zone Etc/GMT-10 10 - GMT-10 Zone Etc/GMT-9 9 - GMT-9 Zone Etc/GMT-8 8 - GMT-8 Zone Etc/GMT-7 7 - GMT-7 Zone Etc/GMT-6 6 - GMT-6 Zone Etc/GMT-5 5 - GMT-5 Zone Etc/GMT-4 4 - GMT-4 Zone Etc/GMT-3 3 - GMT-3 Zone Etc/GMT-2 2 - GMT-2 Zone Etc/GMT-1 1 - GMT-1 Zone Etc/GMT+1 -1 - GMT+1 Zone Etc/GMT+2 -2 - GMT+2 Zone Etc/GMT+3 -3 - GMT+3 Zone Etc/GMT+4 -4 - GMT+4 Zone Etc/GMT+5 -5 - GMT+5 Zone Etc/GMT+6 -6 - GMT+6 Zone Etc/GMT+7 -7 - GMT+7 Zone Etc/GMT+8 -8 - GMT+8 Zone Etc/GMT+9 -9 - GMT+9 Zone Etc/GMT+10 -10 - GMT+10 Zone Etc/GMT+11 -11 - GMT+11 Zone Etc/GMT+12 -12 - GMT+12 Zone Etc/GMT+13 -13 - GMT+13 # GMT offset 12 hours with DST
I very much like the idea of putting the GMT+-nnnn time zones into an Etc subdirectory; I think this clarifies things. I think it would clarify things further if all the etcetera zones and links were put into the Etc directory; we can use `backward' to bring the important ones back to the top level. Since the signs are changed, we now want GMT-13, not GMT+13. The etcetera comments are a bit terse for people who don't know the notation well. Finally, I noticed that `backward' contains Moscow out of order; since `Moscow' was never used before late 1993, we can remove it. So I propose the following changes. =================================================================== RCS file: RCS/etcetera,v retrieving revision 7.2 retrieving revision 7.2.1.1 diff -c -r7.2 -r7.2.1.1 *** etcetera 1994/02/22 23:03:36 7.2 --- etcetera 1994/02/22 23:43:36 7.2.1.1 *************** *** 4,28 **** # 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!) - Zone GMT 0 - GMT - Link GMT UTC - Link GMT UCT - Link GMT Universal - Link GMT Greenwich - Link GMT Zulu - Link GMT GMT-0 - Link GMT GMT+0 - Link GMT GMT0 - # We use POSIX-style signedness in the names and output, # internal-style signedness in the specifications. ! # These are shoved down into an "Etc" directory so we get a name change-- ! # in earlier incarnations, we had lines such as # Zone GMT-12 -12 - GMT-1200 ! # and do not want things to change quietly if someone accustomed to the old # way does a # zic -l GMT-12 Zone Etc/GMT-12 12 - GMT-12 Zone Etc/GMT-11 11 - GMT-11 Zone Etc/GMT-10 10 - GMT-10 --- 4,23 ---- # 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!) # We use POSIX-style signedness in the names and output, # internal-style signedness in the specifications. ! # For example, TZ=Etc/GMT+4 corresponds to 4 hours _behind_ GMT; ! # it is equivalent to TZ=GMT+4, which is implemented directly as per Posix. ! ! # Earlier incarnations of this package were not Posix-compliant, ! # and had lines such as # Zone GMT-12 -12 - GMT-1200 ! # We did not want things to change quietly if someone accustomed to the old # way does a # zic -l GMT-12 + # so we moved the names into the Etc subdirectory. + Zone Etc/GMT-13 13 - GMT-13 # 12 hours ahead of GMT, plus DST Zone Etc/GMT-12 12 - GMT-12 Zone Etc/GMT-11 11 - GMT-11 Zone Etc/GMT-10 10 - GMT-10 *************** *** 35,40 **** --- 30,36 ---- Zone Etc/GMT-3 3 - GMT-3 Zone Etc/GMT-2 2 - GMT-2 Zone Etc/GMT-1 1 - GMT-1 + Zone Etc/GMT 0 - GMT Zone Etc/GMT+1 -1 - GMT+1 Zone Etc/GMT+2 -2 - GMT+2 Zone Etc/GMT+3 -3 - GMT+3 *************** *** 47,50 **** Zone Etc/GMT+10 -10 - GMT+10 Zone Etc/GMT+11 -11 - GMT+11 Zone Etc/GMT+12 -12 - GMT+12 ! Zone Etc/GMT+13 -13 - GMT+13 # GMT offset 12 hours with DST --- 43,54 ---- Zone Etc/GMT+10 -10 - GMT+10 Zone Etc/GMT+11 -11 - GMT+11 Zone Etc/GMT+12 -12 - GMT+12 ! ! Link Etc/GMT Etc/GMT-0 ! Link Etc/GMT Etc/GMT+0 ! Link Etc/GMT Etc/GMT0 ! Link Etc/GMT Etc/Greenwich ! Link Etc/GMT Etc/UCT ! Link Etc/GMT Etc/UTC ! Link Etc/GMT Etc/Universal ! Link Etc/GMT Etc/Zulu =================================================================== RCS file: RCS/backward,v retrieving revision 7.4 retrieving revision 7.4.1.1 diff -c -r7.4 -r7.4.1.1 *** backward 1994/02/07 14:57:49 7.4 --- backward 1994/02/22 23:43:36 7.4.1.1 *************** *** 32,38 **** Link Africa/Cairo Egypt Link Europe/Dublin Eire Link Europe/London GB ! Link Europe/Moscow Moscow Link Asia/Hong_Kong Hongkong Link Atlantic/Reykjavik Iceland Link Asia/Tehran Iran --- 32,39 ---- Link Africa/Cairo Egypt Link Europe/Dublin Eire Link Europe/London GB ! Link Etc/GMT GMT ! Link Etc/GMT Greenwich Link Asia/Hong_Kong Hongkong Link Atlantic/Reykjavik Iceland Link Asia/Tehran Iran *************** *** 65,67 **** --- 66,70 ---- Link America/Denver US/Mountain Link America/Los_Angeles US/Pacific Link Pacific/Samoa US/Samoa + Link Etc/GMT UTC + Link Etc/GMT Universal
participants (2)
-
ado -
eggert@twinsun.com