timezones                package:base                R Documentation

_T_i_m_e _Z_o_n_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Information about time zones in R.  'Sys.timezone' returns the
     current time zone.

_U_s_a_g_e:

     Sys.timezone()

_D_e_t_a_i_l_s:

     Time zones are a system-specific topic, but as from R 2.7.0 almost
     all R platforms use the same underlying code, used by Linux, Mac
     OS X, Solaris, AIX, FreeBSD, Sun Java >= 1.4 and Tcl >= 8.5, and
     supplied with R on Windows.

     It is not in general possible to retrieve the system's own name(s)
     for the current timezone, but 'Sys.timezone' will retrieve the
     name it uses for the current time (and the name may differ
     depending on whether daylight saving time is in effect).

     On most platforms it is  possible to set the time zone via the
     environment variable 'TZ': see the section on 'Time zone names'
     for suitable values.

     Note that the principal difficulty with time zones is their
     individual history: over the last 100 years places have changed
     their affiliation between major time zones, have opted out of (or
     in to) DST in various years or adopted rule changes late or not at
     all.  This often involves tiny administrative units in the
     US/Canada: Iowa had 23 different implementations of DST in the
     1960's!

     Time zones did not come into use until the second half of the
     nineteenth century, and DST was first introduced in the early
     twentieth century, most widely during the First World War (in
     1916). The most common implementation of 'POSIXct' is a signed
     32-bit integers and so only goes back to the end of 1901: on such
     systems R assumes that dates prior to that are in the same time
     zone as they were in 1902.

_V_a_l_u_e:

     'Sys.timezone' returns an OS-specific character string, possibly
     an empty string.  Typically this is an abbreviation such as
     '"EST"'.

_T_i_m_e _z_o_n_e _n_a_m_e_s:

     Where OSes describe their valid time zones can be obscure.  The
     help for the C function 'tzset' can be helpful, but it can also be
     inaccurate.  There is a cumbersome POSIX specification (listed
     under environment variable 'TZ' at <URL:
     http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html>),
     which is often at least partially supported, but there usually are
     other more user-friendly ways to specify timezones.

     Many systems make use of a timezone database compiled by Arthur
     Olson, in which the preferred way to refer to a time zone by a
     location (typically of a city) e.g. 'Europe/London',
     'America/Los_Angeles', 'Pacific/Easter'.  Some traditional
     designations are also allowed such as 'EST5EDT' or 'GB'.  (Beware
     that some of these designations may not be what you think: in
     particular 'EST' is a time zone used in Canada _without_ daylight
     savings time, and not 'EST5EDT' nor (Australian) Eastern Standard
     Time.)  The designation can also be an optional colon prepended to
     the path to a file giving complied zone information (and the
     examples above are all files in a system-specific location).  See
     <URL: http://www.twinsun.com/tz/tz-link.htm> for more details and
     references.

     For most Unix-alikes use the Olson databases.  The 
     system-specific default location in the file system varies, e.g. 
     '/usr/share/zoneinfo', '/usr/etc/zoneinfo', '/usr/lib/zoneinfo' or
     '/usr/share/lib/zoneinfo'.

_N_o_t_e:

     There is currently (2007/8) considerable disruption over changes
     to the timings of the DST transitions, aimed at energy
     conservation. These often have short notice and time zone
     databases may not be up to date (even if the OS has been updated
     recently).

     Note that except on Windows, the operation of time zones is an OS
     service, and even on Windows a third-party database is used and
     can be updated (see the section on 'Time zone names').  Incorrect
     results will never be an R issue, so please ensure that you have
     the courtesy not to blame R for them.

_S_e_e _A_l_s_o:

     'Sys.time', 'as.POSIXlt'.

     <URL: http://en.wikipedia.org/wiki/Time_zone> and <URL:
     http://www.twinsun.com/tz/tz-link.htm> for extensive sets of
     links.

_E_x_a_m_p_l_e_s:

     Sys.timezone()

