[R] Incorrect DST time changes in DateTimeClasses

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Dec 6 16:29:40 CET 2012



On 06.12.2012 15:54, Jeff Newmiller wrote:
> What OS are you using? It makes a difference.

... and R version.

Uwe Ligges

> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
>                                        Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> Andrew Digby <andrewdigby at mac.com> wrote:
>
>>
>> Can anyone please shed any light on why R DateTimeClasses give weird
>> times for when daylight saving time information changes, and which
>> aren't consistent with the OS?
>>
>> Example:
>>
>> 	Expected result: in New Zealand DST stopped (NZDT -> NZST) at 03:00
>> NZDT on 2010-04-04, as confirmed by the OS time zone info (OS X
>> 10.8.2):
>>
>> 	zdump -v /etc/localtime
>> 		/etc/localtime  Sat Apr  3 13:59:59 2010 UTC = Sun Apr  4 02:59:59
>> 2010 NZDT isdst=1
>> 		/etc/localtime  Sat Apr  3 14:00:00 2010 UTC = Sun Apr  4 02:00:00
>> 2010 NZST isdst=0
>>
>> 	Result in R: R has DST changing at 02:26:08, instead of 03:00!
>>
>> 	> a<-as.POSIXlt('2010-04-04 02:26:07',tz="NZ")
>> 	> a$isdst
>> 	[1] 1
>> 	> b<-as.POSIXlt('2010-04-04 02:26:08',tz="NZ")
>> 	> b$isdst
>> 	[1] 0
>>
>>
>> So does R get its DST information from somewhere else? Any suggestions
>> would be much appreciated!
>>
>> Thanks
>>
>> 	[[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.
>
> ______________________________________________
> 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.
>




More information about the R-help mailing list