[Rd] R4.1: seq.POSIXt, tz="AEST" (PR#9572)

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Mar 29 18:31:06 CEST 2007


I think I have managed to track this down, but only by setting a Windows 
box to that timezone via the control panel.

One cannot set a timezone in Windows to one with Australian DST settings, 
and according to my Linux machine you were in DST on 1968-02-28.  That's 
the problem as we compare 1968 with a later year to find the DST settings, 
and during those calculations Windows 'corrects' the tm structure (it is 
not supposed to according to POSIX).

A workaround to the non-POSIX compliance will appear in 2.5.0.

On Tue, 20 Mar 2007, Felix Andrews wrote:

> I am sorry, "AEST" was wrong. I can't work out what timezone code it is, but
> my default timezone here in eastern australia prints as:
>> as.POSIXct("1970-01-01", tz="")
> [1] "1970-01-01 AUS Eastern Daylight Time"
>
> and that is the one that has repeated dates before 1970.
>
> But I take your point that it is fundamentally a problem with Windows.
>
> --Felix
>
>
> On 3/19/07, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
>> 
>> Hmm, AEST is not a valid time zone on Windows.
>> See ?as.POSIXlt for one of several places where this is documented.
>> 
>> But in any case, the underlying problem is in the OS, and we only try to
>> work around it to the best of our knowledge (and that excludes
>> undocumented time zones).
>> 
>> 
>> On Mon, 19 Mar 2007, felix at nfrac.org wrote:
>> 
>> > Times from seq.POSIXt come out wrong in AEST timezone around Feb 29
>> every
>> > leap year before 1970 (on Windows XP).
>> >
>> > According to help(DateTimeClasses), this is handled by "our own C code".
>> >
>> >> x <- as.POSIXct("1968-02-27") # tz="AEST"
>> >> x.gmt <- as.POSIXct("1968-02-27", tz="GMT")
>> >> data.frame(
>> >     GMT=seq(x.gmt, by="day", length=8),
>> >     byday=seq(x, by="day", length=8),
>> >     byDST=seq(x, by="DSTday", length=8))
>> >         GMT      byday      byDST
>> > 1 1968-02-27 1968-02-27 1968-02-27
>> > 2 1968-02-28 1968-02-28 1968-02-28
>> > 3 1968-02-29 1968-03-01 1968-03-02
>> > 4 1968-03-01 1968-03-02 1968-03-02
>> > 5 1968-03-02 1968-03-02 1968-03-02
>> > 6 1968-03-03 1968-03-03 1968-03-03
>> > 7 1968-03-04 1968-03-04 1968-03-04
>> > 8 1968-03-05 1968-03-05 1968-03-05
>> >
>> >> R.version
>> >               _
>> > platform       i386-pc-mingw32
>> > arch           i386
>> > os             mingw32
>> > system         i386, mingw32
>> > status
>> > major          2
>> > minor          4.1
>> > year           2006
>> > month          12
>> > day            18
>> > svn rev        40228
>> > language       R
>> > version.string R version 2.4.1 (2006-12-18)
>> >
>> >
>> >
>> >
>> 
>> --
>> 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
>> 
>

-- 
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-devel mailing list