POSE proposal for TZ

Moderator, John Quarterman std-unix at ut-sally.UUCP
Wed Feb 12 14:07:42 AEST 1986


>From: seismo!hao!asgb!benish!devine
Date: Tue, 11 Feb 86 11:21:51 mst

  Hi, here is a letter that I sent to the IEEE mailing address for
POSE proposals.  It deals with timezones and Daylight Saving Time
rules and how to incorporate them portably into a UNIX environment.
Its advantages are: follows System III/V model; allows users and
programs to override system timezone information; works for all
present country TZ and DST rules; and flexibility.

Bob Devine; 3133 Lake Park Way; Longmont, CO 80501; (303) 772-2410
(seismo!hao!asgb!devine  sdcrdcf!bmcg!asgb!devine)

---------------------------------------------------------------------
    
    Secretary, IEEE Standards Board
    Institute of Electrical and Electronics Engineers
    345 East 17th Street
    New York, NY 10017
    
    
    
    
      This is a suggested resolution for the handling of world timezones
    and Daylight Saving Time for the P1003/Portable Operating System
    Environment document.  Appendix A.3 asked for such a resolution.
    
    
      The major points of the proposal are:
    
    
            1. There is a world-readable, superuser-modifiable file
               named "/etc/TIMEZONE" that describes the per-system
               timezone information and Daylight Saving Time rules.
    
    
            2. TIMEZONE contains the following lines in Bourne shell
               syntax:
    
               TZ=ABC
               DST="dst1 dst2"
               export TZ DST
    
    
            3. The TZ variable has 2 required parts (and an optional 3rd):
    
               A = standard abbreviation for the timezone as used by the
    	       local area
    	           A :== [A-Z][A-Z]*
               B = plus or minus difference in minutes from Universal Time,
               plus for those locations east of GMT, minus for west
                   B :== [+-][0-9][0-9][0-9]
               C = standard abbreviation for the timezone as used by the
    	       local area when Daylight Saving Time is in effect.  This
	       part of TZ may be absent if DST is not used.
                   C :== [A-Z][A-Z]*
    
               Example for my location in Boulder, Colorado, USA:
                   TZ=MST-420MDT
    
    
            4. The DST variable has 0 or 2 parts in the string.  It has
               zero if no Daylight Saving Time is observed or 2, when DST
               starts and ends, for those places that do observe it.  I
               have been unable to locate any place in the world that has
	       1, 3, or more changes per year to its local time.  If DST
	       is not null, the string means:
    
                 dst1 = a string that describes when DST starts
                 dst2 = a string that describes when DST stops
    
               Both have the syntax of "mmddDhhMM%CCcc".  Translating it:
    
                 mm  = the month (January = 01)
                 dd  = the day of the month (01 to 31)
                 D   = the "search-forward" function number
    	           (0-7) usually 1 or 0
                         0 = use the day mm/dd without translation
                         1 = search forward to the first Sunday
                         2 =        "                    Monday
                         3 =        "                    Tuesday
                         4 =        "                    Wednesday
                         5 =        "                    Thursday
                         6 =        "                    Friday
                         7 =        "                    Saturday
                 hh  = the hour at which the change goes into effect
    	           (00-23) usually 01, 02 or 03
                 MM  = the minute at which the change goes into effect
    		   (00-59) usually 00
                 %   = a '+' or a '-' saying what direction to move
                 CC  = how many hours to move (00-23) usually 01 or 02
                 cc  = how many minutes to move (00-23) usually 00
    
               Example for my location in Boulder, Colorado, USA in 1986:
                   DST="042410200+0100  102510200-0100"
               Alternately, if I already know the exact dates that DST
	       starts and ends for that year, I can use:
                   DST="042700200+0100  102600200-0100"
    
    
            5. If the file is unreadable or missing, the default time
	       zone to use is GMT and the default DST is null.
    

            6. The library call "localtime()" is the only system code
               that need interpret the TZ and DST variables.

    
            7. TZ and DST are put into the environment of each user
               when the user logs in.  A user can change create their
               own TZ and DST values and replace the system maintained
               values in their environment.
    
            8. Those utilities that strip off environment information
               can obtain TZ and DST values by reading "/etc/TIMEZONE".
    
    
    
    Bob Devine
    (303) 530-6635
    Burroughs Distributed Systems Group
    6655 Lookout Road
    Boulder, CO. 80301
    
    UUCP: ihnp4!seismo!hao!asgb!devine OR sdcrdcf!bmcg!asgb!devine

Volume-Number: Volume 5, Number 47



More information about the Mod.std.unix mailing list