Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

TIMEZONE(3C)                                                      TIMEZONE(3C)

       timezone - get time zone name given offset from GMT

       char *timezone(zone, dst)

       timezone() attempts to return the name of the time zone associated with
       its first argument, which is measured in minutes westward  from  Green-
       wich.   If  the second argument is 0, the standard name is used, other-
       wise the Daylight Savings Time version.  If the required name does  not
       appear  in  a  table built into the routine, the difference from GMT is
       produced; for instance, in  Afghanistan  `timezone(-(60*4+30),  0)'  is
       appropriate  because it is 4:30 ahead of GMT and the string GMT+4:30 is

       Note: the offset westward from Greenwich and an indication  of  whether
       Daylight  Savings  Time is in effect may not be sufficient to determine
       the name of the time zone, as the name  may  differ  between  different
       locations in the same time zone.  Instead of using timezone() to deter-
       mine the name of the time zone for a given time, that  time  should  be
       converted  to  a  `struct tm' using localtime() (see ctime(3V)) and the
       tm_zone field of that structure should be used.  timezone() is retained
       for compatibility with existing programs.


                                6 October 1987                    TIMEZONE(3C)