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

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

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.