[R] Time zones

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Aug 9 09:29:24 CEST 2004


It depends on your OS, which you haven't told us.  And OSes tend to hide 
the information quite effectively.

On a Unix/Linux system, try 'man tzset'.  That reads named timeszones from
a directory, nowadays /usr/share/zoneinfo or /usr/share/lib/zoneinfo or
something like that.

On Windows, the C runtime has rules like (from the _tzset entry in MSDN)

  TZ=tzn[+|-]hh[:mm[:ss] ][dzn]

  tzn
  Three-letter time-zone name, such as PST. You must specify the correct 
  offset from local time to UTC.

  hh
  Difference in hours between UTC and local time. Optionally signed.

  mm
  Minutes. Separated from hh by a colon (:).

  ss
  Seconds. Separated from mm by a colon (:).

  dzn
  Three-letter daylight-saving-time zone such as PDT. If daylight saving 
  time is never in effect in the locality, set TZ without a value for dzn. 
  The C run-time library assumes the United States's rules for 
  implementing the calculation of Daylight Saving Time (DST). 

so it seems EST5EDT would be correct (but I didn't find a list of 
names).

Did you try EST5EDT to see if it seemed to work?


On Mon, 9 Aug 2004, David Scott wrote:

> I am analysing some data collected over a number of months from Allentown, 
> PA, which is just north of Philadelphia. I am using as.POSIXct for dates 
> and times, and I need to get the timezone specification correct.
> 
> Going on the documentation for DateTimeClasses, I believe one way to 
> specify the correct time zone is
> 
> tz="EST5EDT"
> 
> I would be grateful for any advice on this. I ask because I haven't been 
> able to find a list of all the possible time zones or formats that can be 
> used. I have done a bit of googling without to much success.


-- 
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 mailing list