[R] removing daylight savings in R

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 11 09:54:54 CET 2009


On Wed, 11 Mar 2009, Rhiannon Marchant wrote:

>
>   Hello,
>   Thanks the Prof. Brian Ripley for his earlier response, however I still have
>   a few issues with the times in R.
>   I'd like to somehow set up R so it automatically has the timezone set to
>   Western Australian standard time when I open up a workspace instead of
>   Western Australian daylight savings time. Is this possible? I haven't had
>   much luck in trying to find this.

Yes, see ?Sys.timezone (as described in my earlier reply).  According 
to Wikipedia that is not an actual timezone, but it seems you want 
TZ='GMT-8'.  As that is not a known timezone, you will get some 
messages when trying to print the time and (spuriously) GMT as the 
timezone names, but input conversion did work.

The best thing to do would be to create a timezone with the names you 
want and recreate the zoneinfo database: there are instructions on how 
to do so in the R sources.

Life would be a lot easier if you keep times in an official timezone 
or UTC.  I would suggest reading them as if in UTC (again, I explained 
that in my first reply) and shifting by 8 hours (subtract 8*3600): you 
can then print them in UTC or a real-world time.

[...]


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