From ripley at stats.ox.ac.uk  Fri Sep  1 12:43:54 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 1 Sep 2006 11:43:54 +0100 (BST)
Subject: [Rd] Date conversion with as.POSIXct and as.POSIXlt (PR#9196)
In-Reply-To: <x264g7zyop.fsf@viggo.kubism.ku.dk>
References: <20060901092716.784165866B@slim.kubism.ku.dk>
	<x264g7zyop.fsf@viggo.kubism.ku.dk>
Message-ID: <Pine.LNX.4.64.0609011137060.11470@gannet.stats.ox.ac.uk>

On Fri, 1 Sep 2006, Peter Dalgaard wrote:

[...]

> I'm not sure any of this is actual bugs (Brian will tell us soon
> enough), but it does appear at least to be underdocumented.

(Your message crossed mine.)

I think it is not a bug and actually explicitly documented in ?as.POSIXlt.  
What may help those who have not read that documentation is to stick the 
UTC timezone on the conversion to POSIXlt.  Getting

> as.POSIXlt(Sys.Date())
[1] "2006-09-01 UTC"
> as.POSIXct(as.POSIXlt(Sys.Date()))
[1] "2006-09-01 UTC"
> as.POSIXct(as.POSIXlt(Sys.Date()), tz="")
[1] "2006-09-01 01:00:00 GMT Daylight Time"

might be helpful to non-readers.

-- 
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




[Rd] Date conversion with as.POSIXct and as.POSIXlt (PR#9196)
Prof Brian Ripley