home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / cat3 / tzset.0 < prev    next >
Text File  |  1993-12-07  |  8KB  |  199 lines

  1.  
  2. TZSET(3)                   UNIX Programmer's Manual                   TZSET(3)
  3.  
  4. NNAAMMEE
  5.      ttzzsseett, ttzzsseettwwaallll - initialize time conversion information
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ttiimmee..hh>>
  9.  
  10.      _v_o_i_d
  11.      ttzzsseett(_v_o_i_d)
  12.  
  13.      _v_o_i_d
  14.      ttzzsseettwwaallll(_v_o_i_d)
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The ttzzsseett() function initializes time conversion information used by the
  18.      library routine localtime(3).  The environment variable TZ specifies how
  19.      this is done.
  20.  
  21.      If TZ does not appear in the environment, the best available approxima­
  22.      tion to local wall clock time, as specified by the tzfile(5)­format  file
  23.      _/_e_t_c_/_l_o_c_a_l_t_i_m_e is used.
  24.  
  25.      If TZ appears in the environment but its value is a null string, Coordi­
  26.      nated Universal Time (UTC) is used (without leap second correction).
  27.  
  28.      If TZ appears in the environment and its value begins with a colon (`'):,
  29.      the rest of its value is used as a pathname of a tzfile(5)­format  file
  30.      from which to read the time conversion information.  If the first charac­
  31.      ter of the pathname is a slash (`/') it is used as an absolute pathname;
  32.      otherwise, it is used as a pathname relative to the system time conver­
  33.      sion information directory.
  34.  
  35.      If its value does not begin with a colon, it is first used as the path­
  36.      name of a file (as described above) from which to read the time conver­
  37.      sion information.  If that file cannot be read, the value is then inter­
  38.      preted as a direct specification (the format is described below) of the
  39.      time conversion information.
  40.  
  41.      If the TZ environment variable does not specify a tzfile(5)­format  file
  42.      and cannot be interpreted as a direct specification, UTC is used.
  43.  
  44.      The ttzzsseettwwaallll() function sets things up so that localtime returns the
  45.      best available approximation of local wall clock time.
  46.  
  47. SSPPEECCIIFFIICCAATTIIOONN FFOORRMMAATT
  48.      When TZ is used directly as a specification of the time conversion infor­
  49.      mation, it must have the following syntax (spaces inserted for clarity):
  50.  
  51.            _s_t_d _o_f_f_s_e_t [_d_s_t [_o_f_f_s_e_t] [ , _r_u_l_e]]
  52.  
  53.      Where:
  54.  
  55.            _s_t_d and _d_s_t  Three or more bytes that are the designation for the
  56.                         standard (_s_t_d) or summer (_d_s_t) time zone.  Only _s_t_d is
  57.                         required; if _d_s_t is missing, then summer time does not
  58.                         apply in this locale.  Upper and lowercase letters are
  59.                         explicitly allowed.  Any characters except a leading
  60.                         colon (`'):, digits, comma (`,'), minus (`-'), plus
  61.                         (`+'), and ASCII NUL are allowed.
  62.  
  63.            _o_f_f_s_e_t       Indicates the value one must add to the local time to
  64.                         arrive at Coordinated Universal Time.  The _o_f_f_s_e_t has
  65.                         the form:
  66.  
  67.                               _h_h [:_m_m[ : _s_s]]
  68.  
  69.                         The minutes (_m_m) and seconds (_s_s) are optional.  The
  70.                         hour (_h_h) is required and may be a single digit.  The
  71.                         _o_f_f_s_e_t following _s_t_d is required.  If no _o_f_f_s_e_t fol­
  72.                         lows _d_s_t, summer time is assumed to be one hour ahead
  73.                         of standard time.  One or more digits may be used; the
  74.                         value is always interpreted as a decimal number.  The
  75.                         hour must be between zero and 24, and the minutes (and
  76.                         seconds) ­­ if present ­­ between zero and 59.  If
  77.                         preceded by a (`-') the time zone shall be east of the
  78.                         Prime Meridian; otherwise it shall be west (which may
  79.                         be indicated by an optional preceding (`+')).
  80.  
  81.            _r_u_l_e         Indicates when to change to and back from summer time.
  82.                         The _r_u_l_e has the form:
  83.  
  84.                               _d_a_t_e_/_t_i_m_e_,_d_a_t_e_/_t_i_m_e
  85.  
  86.                         where the first _d_a_t_e describes when the change from
  87.                         standard to summer time occurs and the second _d_a_t_e de­
  88.                         scribes when the change back happens.  Each _t_i_m_e field
  89.                         describes when, in current local time, the change to
  90.                         the other time is made.
  91.  
  92.                         The format of _d_a_t_e is one of the following:
  93.  
  94.                         JJ _n      The Julian day _n (1 <= _n <= 365).  Leap days
  95.                                  are not counted; that is, in all years ­­ in­
  96.                                  cluding leap years ­­ February 28 is day 59
  97.                                  and March 1 is day 60.  It is impossible to
  98.                                  explicitly refer to the occasional February
  99.                                  29.
  100.  
  101.                         _n        The zero­based Julian day (0 <= _n <= 365 ) .
  102.                                  Leap days are counted, and it is possible to
  103.                                  refer to February 29.
  104.  
  105.                         MM _m_._n_._d  The _d'th day (0 <= _d <= 6 ) of week _n of
  106.                                  month _m of the year (1 <= _n <= 5), (1 <= _m <=
  107.                                  12), where week 5 means ``the last _d day in
  108.                                  month _m'' which may occur in either the
  109.                                  fourth or the fifth week).  Week 1 is the
  110.                                  first week in which the _d'th day occurs.  Day
  111.                                  zero is Sunday.
  112.  
  113.                                  The _t_i_m_e has the same format as _o_f_f_s_e_t except
  114.                                  that no leading sign (`-') or (`+') is al­
  115.                                  lowed.  The default, if _t_i_m_e is not given, is
  116.                                  0022::0000::0000.
  117.  
  118.                         If no _r_u_l_e is present in the TZ specification, the
  119.                         rules specified by the tzfile(5)­format  file
  120.                         _p_o_s_i_x_r_u_l_e_s in the system time conversion information
  121.                         directory are used, with the standard and summer time
  122.                         offsets from UTC replaced by those specified by the
  123.                         _o_f_f_s_e_t values in TZ.
  124.  
  125.      For compatibility with System V Release 3.1, a semicolon (`'); may be
  126.      used to separate the _r_u_l_e from the rest of the specification.
  127.  
  128. FFIILLEESS
  129.      /etc/localtime                  local time zone file
  130.  
  131.  
  132.      /usr/share/zoneinfo             time zone directory
  133.      /usr/share/zoneinfo/posixrules  rules for POSIX­style TZ's
  134.      /usr/share/zoneinfo/GMT  for    UTC leap seconds
  135.  
  136.      If the file _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_G_M_T does not exist, UTC leap seconds are
  137.      loaded from _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_p_o_s_i_x_r_u_l_e_s.
  138.  
  139. SSEEEE AALLSSOO
  140.      date(1),  gettimeofday(2),  ctime(3),  getenv(3),  time(3),  tzfile(5)
  141.  
  142. HHIISSTTOORRYY
  143.      The ttzzsseett and ttzzsseettwwaallll functions are currently under development.
  144.  
  145. BSD Experimental                 July 23, 1991                               3
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.