Re: [R] Daylight Savings Time unknown in R-2.2.1

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sat 07 Jan 2006 - 19:37:12 EST

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@alum.mit.edu)
>
> ______________________________________________
> R-help@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@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

______________________________________________
R-help@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
Received on Sat Jan 07 19:46:09 2006

This archive was generated by hypermail 2.1.8 : Sat 07 Jan 2006 - 22:08:52 EST