Re: [R] POSIXct time zone and daylight savings issues

From: Sebastian P. Luque <>
Date: Sat 28 Oct 2006 - 01:19:43 GMT

On Fri, 27 Oct 2006 14:55:15 -0400,
"Gabor Grothendieck" <> 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.



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Oct 28 11:32:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 30 Oct 2006 - 17:30:15 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.