[R] Daylight Savings Time unknown in R-2.2.1
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sat Jan 7 09:37:12 CET 2006
POSIX does not require strptime() to set the timezone. This changed in
2.2.1 as part of
o ISODateTime() mistakenly corrected non-existent times (when
DST was being started) in the current time zone.
You can get the isdst by doing a conversion, e.g.
> x <- strptime(20051208, "%Y%m%d")
> x
[1] "2005-12-08"
> as.POSIXlt(as.POSIXct(x))
[1] "2005-12-08 GMT"
> as.POSIXlt(as.POSIXct(x))$isdst
[1] 0
It's easy to set it again, and I will do so in 2.2.1 patched.
On Fri, 6 Jan 2006, Brahm, David wrote:
> Under R-2.2.1, a POSIXlt date created with "strptime" has an unknown
> Daylight Savings Time flag:
>
>> strptime(20051208, "%Y%m%d")$isdst
> [1] -1
>
> This is true on both Linux (details below) and Windows. It did not
> occur under R-2.1.0. Any ideas? TIA!
>
>
>> Sys.getenv("TZ")
> TZ
> ""
>
> Version:
> platform = i686-pc-linux-gnu
> arch = i686
> os = linux-gnu
> system = i686, linux-gnu
> status =
> major = 2
> minor = 2.1
> year = 2005
> month = 12
> day = 20
> svn rev = 36812
> language = R
>
> Locale:
> C
>
> Search Path:
> .GlobalEnv, package:methods, package:stats, package:graphics,
> package:grDevices, package:utils, package:datasets, Autoloads,
> package:base
>
> -- David Brahm (brahm at alum.mit.edu)
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list