Dennis Fisher
2008-Nov-03 20:49 UTC
[R] Unexpected behavior of difftime in relationship to daylight savings time
Colleagues, 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 code below suggests that R (version 2.8.0 in OS X) implements the change at 2:16AM: Expected:> > 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 minsNot expected:> > difftime("2008-11-02 01:17:00", "2008-11-02 01:16:00") > Time difference of 1.016667 hoursCan anyone explain this? Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-415-564-2220 www.PLessThan.com [[alternative HTML version deleted]]