From mdsumner at utas.edu.au  Wed Oct 26 23:33:34 2005
From: mdsumner at utas.edu.au (Michael Sumner)
Date: Thu, 27 Oct 2005 08:33:34 +1100
Subject: [Rd] strptime problem for 2004-10-03 02:00:00
In-Reply-To: <mailman.13.1130320801.9508.r-devel@r-project.org>
References: <mailman.13.1130320801.9508.r-devel@r-project.org>
Message-ID: <435FF62E.2020105@utas.edu.au>

Great.  Thanks for confirmation.

Cheers, Mike.

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

----------------------------

Message: 16
Date: Tue, 25 Oct 2005 21:33:54 +0100 (BST)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Subject: Re: [Rd] strptime problem for 2004-10-03 02:00:00
To: Michael Sumner <mdsumner at utas.edu.au>
Cc: r-devel at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.61.0510252030330.24595 at gannet.stats>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

It's a bug, a rather rare one.  2004-10-03 02:00:00 does not exist in your 
time zone, and in trying to find out if the time is on DST or not it has 
failed to find out.  It needs to be told that GMT is never on DST so not 
to bother.

On Linux, running R with TZ="GMT" set should fix this.  Windows is harder 
to control since it does not distinguish the UK timezone from GMT.

There is a bugfix now in R-devel.  It may migrate to R-patched in due 
course.

On Tue, 25 Oct 2005, Michael Sumner wrote:


>> Hello, I at first thought this was a system or locale issue, but since
>> it occurs on
>> both Windows and Linux and only for 2004 (AFAIK) I report it.
>>
>> I have a problem with as.POSIXct for the hour between
>> "2004-10-03 02:00:00 GMT" and "2004-10-03 02:59:59 GMT".
>>
>> In short, the 2 AM (GMT) hour in 2004 (but not in other years) is
>> interpreted as 1 AM by strptime:
>> (I use ISOdatetime as a convenience).
>>
>> ## Windows XP
>>
>> ISOdatetime(2004, 10, 3, 2, 0, 0,  tz = "GMT")
>> ##[1] "2004-10-03 01:00:00 GMT"
>> ISOdatetime(2004, 10, 3, 1, 0, 0,  tz = "GMT")
>> ##[1] "2004-10-03 01:00:00 GMT"
>>
>> ISOdatetime(2005, 10, 3, 2, 0, 0,  tz = "GMT")
>> ##[1] "2005-10-03 02:00:00 GMT"
>> ISOdatetime(2005, 10, 3, 1, 0, 0,  tz = "GMT")
>> ## [1] "2005-10-03 01:00:00 GMT"
>>
>



[Rd] strptime problem for 2004-10-03 02:00:00
Michael Sumner