From gavin.simpson at ucl.ac.uk  Fri Feb  4 16:28:42 2011
From: gavin.simpson at ucl.ac.uk (Gavin Simpson)
Date: Fri, 04 Feb 2011 15:28:42 +0000
Subject: [Rd] terribly annoying bug with POSIXlt : one o'clock is
 midnight?
In-Reply-To: <AANLkTi=sY4fzwZ1SBSnW540FXPMEay3rAciv_u2M5hvm@mail.gmail.com>
References: <AANLkTi=sY4fzwZ1SBSnW540FXPMEay3rAciv_u2M5hvm@mail.gmail.com>
Message-ID: <1296833322.2445.28.camel@desktop.localdomain>

On Fri, 2011-02-04 at 16:21 +0100, Joris Meys wrote:
> Apparently, as.POSIXlt takes one o'clock as the start of the day :
> 
> > as.POSIXlt(0,origin="1970-01-01")
> [1] "1970-01-01 01:00:00 CET"
> > as.POSIXlt(0,origin="1970-01-01 00:00:00")
> [1] "1970-01-01 01:00:00 CET"
> > as.POSIXlt(0,origin="1970-01-01 23:59:59")
> [1] "1970-01-02 00:59:59 CET"
> 
> Cheers

Isn't this just a timezone thing? CET is an hour ahead of UTC (GMT)

> as.POSIXlt(0,origin="1970-01-01")
[1] "1970-01-01 01:00:00 BST"
> as.POSIXlt(0,origin="1970-01-01", tz = "GMT")
[1] "1970-01-01 GMT"
> as.POSIXlt(0,origin="1970-01-01 00:00:00")
[1] "1970-01-01 01:00:00 BST"
> as.POSIXlt(0,origin="1970-01-01 00:00:00", tz = "GMT")
[1] "1970-01-01 GMT"
> as.POSIXlt(0,origin="1970-01-01 23:59:59", tz = "GMT")
[1] "1970-01-01 23:59:59 GMT"

G
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



[Rd] terribly annoying bug with POSIXlt : one o'clock is midnight?
Gavin Simpson