[R] RODBC & POSIX & Daylight Saving blues

Gabor Grothendieck ggrothendieck at myway.com
Thu Nov 11 17:41:13 CET 2004

Gabor Grothendieck <ggrothendieck <at> myway.com> writes:

: Prof Brian Ripley <ripley <at> stats.ox.ac.uk> writes:

: : If you set it to GMT for the duration of the sqlFetch call, it should do
: : as you intended (but had not told R, which is not clairvoyant).
: : 
: On Windows you have to set the whole computer to GMT which has

Paul Roebuck pointed out to me offlist that this can be done
per process in Windows too so I was wrong on this point.

   ... start up Windows console ...
   cd \Program Files\rw2001beta
   set TZ=GMT

In R,

   Sys.time() # displays date and time in GMT time zone

I also tried doing this from within R but was unsuccessful:

   R> Sys.time()
   [1] "2004-11-11 11:37:53 Eastern Standard Time"
   R> Sys.putenv(TZ = "GMT")
   R> Sys.time()  # wanted GMT result but did not get it
   [1] "2004-11-11 11:38:08 Eastern Standard Time"
   R> R.version.string  # Windows XP
   [1] "R version 2.0.1, 2004-11-04"

More information about the R-help mailing list