home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v5 / text0046.txt < prev    next >
Encoding:
Text File  |  1987-06-30  |  5.1 KB  |  129 lines

  1. >From: seismo!hao!asgb!benish!devine
  2. Date: Tue, 11 Feb 86 11:21:51 mst
  3.  
  4.   Hi, here is a letter that I sent to the IEEE mailing address for
  5. POSE proposals.  It deals with timezones and Daylight Saving Time
  6. rules and how to incorporate them portably into a UNIX environment.
  7. Its advantages are: follows System III/V model; allows users and
  8. programs to override system timezone information; works for all
  9. present country TZ and DST rules; and flexibility.
  10.  
  11. Bob Devine; 3133 Lake Park Way; Longmont, CO 80501; (303) 772-2410
  12. (seismo!hao!asgb!devine  sdcrdcf!bmcg!asgb!devine)
  13.  
  14. ---------------------------------------------------------------------
  15.     
  16.     Secretary, IEEE Standards Board
  17.     Institute of Electrical and Electronics Engineers
  18.     345 East 17th Street
  19.     New York, NY 10017
  20.     
  21.     
  22.     
  23.     
  24.       This is a suggested resolution for the handling of world timezones
  25.     and Daylight Saving Time for the P1003/Portable Operating System
  26.     Environment document.  Appendix A.3 asked for such a resolution.
  27.     
  28.     
  29.       The major points of the proposal are:
  30.     
  31.     
  32.             1. There is a world-readable, superuser-modifiable file
  33.                named "/etc/TIMEZONE" that describes the per-system
  34.                timezone information and Daylight Saving Time rules.
  35.     
  36.     
  37.             2. TIMEZONE contains the following lines in Bourne shell
  38.                syntax:
  39.     
  40.                TZ=ABC
  41.                DST="dst1 dst2"
  42.                export TZ DST
  43.     
  44.     
  45.             3. The TZ variable has 2 required parts (and an optional 3rd):
  46.     
  47.                A = standard abbreviation for the timezone as used by the
  48.                local area
  49.                    A :== [A-Z][A-Z]*
  50.                B = plus or minus difference in minutes from Universal Time,
  51.                plus for those locations east of GMT, minus for west
  52.                    B :== [+-][0-9][0-9][0-9]
  53.                C = standard abbreviation for the timezone as used by the
  54.                local area when Daylight Saving Time is in effect.  This
  55.            part of TZ may be absent if DST is not used.
  56.                    C :== [A-Z][A-Z]*
  57.     
  58.                Example for my location in Boulder, Colorado, USA:
  59.                    TZ=MST-420MDT
  60.     
  61.     
  62.             4. The DST variable has 0 or 2 parts in the string.  It has
  63.                zero if no Daylight Saving Time is observed or 2, when DST
  64.                starts and ends, for those places that do observe it.  I
  65.                have been unable to locate any place in the world that has
  66.            1, 3, or more changes per year to its local time.  If DST
  67.            is not null, the string means:
  68.     
  69.                  dst1 = a string that describes when DST starts
  70.                  dst2 = a string that describes when DST stops
  71.     
  72.                Both have the syntax of "mmddDhhMM%CCcc".  Translating it:
  73.     
  74.                  mm  = the month (January = 01)
  75.                  dd  = the day of the month (01 to 31)
  76.                  D   = the "search-forward" function number
  77.                    (0-7) usually 1 or 0
  78.                          0 = use the day mm/dd without translation
  79.                          1 = search forward to the first Sunday
  80.                          2 =        "                    Monday
  81.                          3 =        "                    Tuesday
  82.                          4 =        "                    Wednesday
  83.                          5 =        "                    Thursday
  84.                          6 =        "                    Friday
  85.                          7 =        "                    Saturday
  86.                  hh  = the hour at which the change goes into effect
  87.                    (00-23) usually 01, 02 or 03
  88.                  MM  = the minute at which the change goes into effect
  89.                (00-59) usually 00
  90.                  %   = a '+' or a '-' saying what direction to move
  91.                  CC  = how many hours to move (00-23) usually 01 or 02
  92.                  cc  = how many minutes to move (00-23) usually 00
  93.     
  94.                Example for my location in Boulder, Colorado, USA in 1986:
  95.                    DST="042410200+0100  102510200-0100"
  96.                Alternately, if I already know the exact dates that DST
  97.            starts and ends for that year, I can use:
  98.                    DST="042700200+0100  102600200-0100"
  99.     
  100.     
  101.             5. If the file is unreadable or missing, the default time
  102.            zone to use is GMT and the default DST is null.
  103.     
  104.  
  105.             6. The library call "localtime()" is the only system code
  106.                that need interpret the TZ and DST variables.
  107.  
  108.     
  109.             7. TZ and DST are put into the environment of each user
  110.                when the user logs in.  A user can change create their
  111.                own TZ and DST values and replace the system maintained
  112.                values in their environment.
  113.     
  114.             8. Those utilities that strip off environment information
  115.                can obtain TZ and DST values by reading "/etc/TIMEZONE".
  116.     
  117.     
  118.     
  119.     Bob Devine
  120.     (303) 530-6635
  121.     Burroughs Distributed Systems Group
  122.     6655 Lookout Road
  123.     Boulder, CO. 80301
  124.     
  125.     UUCP: ihnp4!seismo!hao!asgb!devine OR sdcrdcf!bmcg!asgb!devine
  126.  
  127. Volume-Number: Volume 5, Number 47
  128.  
  129.