[R] POSIXct time zone and daylight savings issues

Sebastian P. Luque spluque at gmail.com
Mon Oct 30 17:39:14 CET 2006


Hi again,

A related issue I can't quite understand is:


R> tt <- as.POSIXct("2006-05-24", tz="EEST")
R> tt
[1] "2006-05-24 EEST"
R> seq(tt, length=12, by="months")
 [1] "2006-05-24 EEST" "2006-06-24 EEST" "2006-07-24 EEST" "2006-08-24 EEST"
 [5] "2006-09-24 EEST" "2006-10-24 EEST" "2006-11-24 EEST" "2006-12-24 EEST"
 [9] "2007-01-24 EEST" "2007-02-24 EEST" "2007-03-24 EEST" "2007-04-24 EEST"
R> tt <- as.POSIXct("2006-05-24", tz="EET")
R> seq(tt, length=12, by="months")
 [1] "2006-05-24 EEST" "2006-06-24 EEST" "2006-07-24 EEST" "2006-08-24 EEST"
 [5] "2006-09-24 EEST" "2006-10-24 EEST" "2006-11-24 EET"  "2006-12-24 EET" 
 [9] "2007-01-24 EET"  "2007-02-24 EET"  "2007-03-24 EET"  "2007-04-24 EEST"
R> sessionInfo()
R version 2.4.0 (2006-10-03) 
x86_64-pc-linux-gnu 

locale:
LC_CTYPE=en_CA.UTF-8;LC_NUMERIC=C;LC_TIME=en_CA.UTF-8;LC_COLLATE=en_CA.UTF-8;LC_MONETARY=en_CA.UTF-8;LC_MESSAGES=en_CA.UTF-8;LC_PAPER=en_CA.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_CA.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets" 
[7] "base"     

other attached packages:
 lattice 
"0.14-9" 


i.e. daylight savings 'tzone' attribute gets adjusted automatically when
providing the standard time attribute, but not when providing the daylight
savings time.  Does this behaviour depend on the OS/locale?  Should the
'tz' argument supplied when creating POSIXct objects always be the
standard time version?


Cheers,

-- 
Seb



More information about the R-help mailing list