[R] RODBC & POSIX & Daylight Saving blues

Duncan Murdoch murdoch at stats.uwo.ca
Fri Nov 12 17:55:21 CET 2004


On Fri, 12 Nov 2004 16:27:41 +0000, Bernie McConnell
<bm8 at st-andrews.ac.uk> wrote :

>Many thanks for the responses about how to read datetimes into POSIXct 
>which refer to straight GMT times without regard to Daylight Saving.  To 
>reiterate, I''m using R 2.0.0 on win2000.
>
>I have tried Gabor's suggestion,see below, which did not work for me.  The 
>fundamental setting (for me) appears to be in the registry:
>
>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
>
>The values here are most readily altered using the 'Date/ TIme properties' 
>window (just double click the wee digital clock on the right of the window 
>task bar).  When I disable Daylight Saving a registry variable 
>called  DisableAutoDaylightTimeSet is created and is set to 1.  This can be 
>observed with regedit.  Now all works perfectly with my date handling.  So 
>it seems that setting the timezone to GMT is necessary but not sufficient 
>for my needs
>
>I confess that I do not understand the relationship between setting 
>registry variables and environment (eg TZ="GMT").
>
>In practice I would like to keep my win200 machine with Daylight Saving 
>enabled - for the sake of other applications.  One strategy is to make the 
>required registry alterations immediately before and after any R code which 
>handles dates.  But then I'm rather worried whether continuously enabling / 
>disabling Daylight Saving would have dire consequences for other 
>applications and the well-being of my already shaky OS.  Is this the right 
>route - and if so could someone please guide me how to achieve this in R 
>for win2000?
>
>Perhaps a better strategy would be to introduce some set-able option within 
>R that forced date handling to ignore Daylight Saving.  But here I have 
>insufficient expertise and can only appeal to the continuing generosity of 
>the developer community.
>
>I am sure that there are many R users in the same position as me - but 
>perhaps they don't all realize it!

I think you probably want to use as.is=TRUE when you retrieve the
results, then use the date conversion functions to specify the time
zone explicitly, e.g. asPOSIXct(x, tz='GMT'). 

Duncan Murdoch




More information about the R-help mailing list