[R] Unexpected behavior of clocktime related to daylight savings time

From: Dennis Fisher <fisher_at_plessthan.com>
Date: Fri, 07 Nov 2008 05:45:52 -0800


I submitted this several days ago and no one responded, so I am trying again, trying a different subject line:

I just encountered some unexpected behavior of difftime in relationship to the change from daylight savings to standard time.

My understanding is that DST and ST take effect at 2AM. However, the results below suggests that R (version 2.8.0 in OS X) implements the change at 2:16AM:

> > difftime("2008-11-02 02:01:00", "2008-11-02 00:59:00")
> Time difference of 2.033333 hours
> > difftime("2008-11-02 01:16:00", "2008-11-02 01:15:00")
> Time difference of 1 mins
> > difftime("2008-11-02 01:18:00", "2008-11-02 01:17:00")
> Time difference of 1 mins

Not expected:
> > difftime("2008-11-02 01:17:00", "2008-11-02 01:16:00")
> Time difference of 1.016667 hours

Can anyone explain this?


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220

        [[alternative HTML version deleted]]

R-help_at_r-project.org 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 Fri 07 Nov 2008 - 13:51:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Nov 2008 - 00:30:23 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.

list of date sections of archive