[R] POSIX time zone codes
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Mar 9 14:57:36 CET 2006
On Wed, 8 Mar 2006, Don MacQueen wrote:
> I would have suggested "US/Central", by analogy with "US/Pacific"
> which I use on my unix-like Mac OS X 10.3.9 system. I don't know what
> might be "common knowledge" in UNIX circles, but here's a bit of
> information from my system.
> It has a directory named /usr/share/zoneinfo.
> zoneinfo% pwd
> zoneinfo% ls | grep DT
> There are files named GMT, UTC, GB, and a number of others.
> There are numerous subdirectories, including for example, "Asia",
> "Australia", "Europe", "US".
> zoneinfo% cd US
> US% ls
> ./ Aleutian East-Indiana Indiana-Starke Pacific
> ../ Arizona Eastern Michigan Pacific-New
> Alaska Central Hawaii Mountain Samoa
> This suggests to me that valid values for the tz argument are
> relative paths to files /usr/share/zoneinfo, but I don't know that
> for a fact.
That is documented as _one_ of the allowed forms on MacOS X, and 'man
tzset' will show you others (I looked at online version for your OS).
Strictly, that form should be preceded by a colon, that is ':US/Central'.
But the information is only in 'man tzset' on some systems.
According to http://www.twinsun.com/tz/tz-link.htm this is the case on
most Unix-alikes, although the base path differs considerably.
However, :US/Central is not valid on Windows, and in fact as far as I know
Windows only allows you to set (via TZ) timezones with no DST or the US
rules for DST. The Control Panel knows some other sets of rules.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help