[R] POSIXct time zone and daylight savings issues

Sebastian P. Luque spluque at gmail.com
Sat Oct 28 03:19:43 CEST 2006


On Fri, 27 Oct 2006 14:55:15 -0400,
"Gabor Grothendieck" <ggrothendieck at gmail.com> wrote:

> Try this: gmtDiff <- function(time) time - as.POSIXct(format(time), tz =
> "GMT")

> gmtDiff(Sys.time()) gmtDiff(as.POSIXct("2006-10-27", tz = "GMT"))

> which both give me the correct answer currently.

> The expression after the minus sign comes from the table at the end of
> the help desk article in R News 4/1.  I think you got the parentheses
> wrong in your version and I think the isdst calculation needs to be
> omitted -- I get the right answer if I leave it out but wrong with it.

Thanks Gabor, this provides the correct result, and the isdst calculation
is no longer needed.


Cheers,

-- 
Seb



More information about the R-help mailing list