[Rd] seq.POSIXt: & DST (PR#1256)

Prof Brian Ripley ripley@stats.ox.ac.uk
Fri, 11 Jan 2002 15:54:56 +0000 (GMT)


On Fri, 11 Jan 2002 jutans@utans.u-net.com wrote:

> Full_Name: Joachim Utans
> Version: 1.4.0
> OS: NT4 sp4
> Submission from: (NULL) (195.42.238.80)
>
>
> seq.POSIXt(..., by="day") apparently has problems steping over
> a change in daylight savings time; 2001-10-28 appears twice,
> the last day, 2001-10-30, is missing

Take a closer look.  It is stepping by days, but that means by 24-hour
days.  Look at it in GMT (there is no such time zone as GMT Daylight Time,
Bill Gates!)

z <- seq(as.POSIXct("2001-10-26"),as.POSIXct("2001-10-30"),by="day")
> format(z, tz="GMT")
[1] "2001-10-25 23:00:00" "2001-10-26 23:00:00" "2001-10-27 23:00:00"
[4] "2001-10-28 23:00:00" "2001-10-29 23:00:00"

which is correct.

> > seq(as.POSIXct("2001-10-26"),as.POSIXct("2001-10-30"),by="day")
> [1] "2001-10-26 00:00:00 GMT Daylight Time" "2001-10-27 00:00:00 GMT Daylight
> Time" "2001-10-28 00:00:00 GMT Daylight Time"
> [4] "2001-10-28 23:00:00 GMT Standard Time" "2001-10-29 23:00:00 GMT Standard
> Time"


-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._