After the discussions which really helped me understanding
the issues involved let me summarize some possibly surprising
behavior of as.POSIXlt and as.POSIXct and the print method of
class POSIXlt (the print method problem seems to be a Windows
only problem) in R 2.3.1
- as.POSIXlt and as.POSIXct
On 1 September 2006 at 06:25, Gabor Grothendieck wrote:
| Note that there is some discussion in the help desk article
| in R News 4/1 and a table of tested conversions at
| the end of that article.If x is of class "Date" then for
| converting from Date to POSIXct the table suggests
| as.POSIXc
On Fri, 1 Sep 2006, Peter Dalgaard wrote:
> Prof Brian Ripley <[EMAIL PROTECTED]> writes:
>
> > 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.
>
Prof Brian Ripley <[EMAIL PROTECTED]> writes:
> 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 bu
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 hel
Note that there is some discussion in the help desk article
in R News 4/1 and a table of tested conversions at
the end of that article.If x is of class "Date" then for
converting from Date to POSIXct the table suggests
as.POSIXct(format(x)) or as.POSIXct(format(x), tz = "GMT")
according to whet
You misunderstand the role of timezones.
as.POSIXct(Sys.Date())
is in UTC, as documented.
as.POSIXlt(Sys.Date())
does not have a timezone (POSIXlt objects do not need one).
as.POSIXct(as.POSIXlt(Sys.Date()))
means
as.POSIXct(as.POSIXlt(Sys.Date()), tz="")
which is asking to interpret this i
[EMAIL PROTECTED] writes:
> Full_Name: Erich Neuwirth
> Version: 2.3.1
> OS: Windows XP, Linux
> Submission from: (NULL) (131.130.135.167)
>
>
> Converting Sys.Date() to a POSIX compliant time type in different ways
> produces inconsistent results:
> > Sys.date()
> [1] "2006-09-01"
> > as.POSIX
Full_Name: Erich Neuwirth
Version: 2.3.1
OS: Windows XP, Linux
Submission from: (NULL) (131.130.135.167)
Converting Sys.Date() to a POSIX compliant time type in different ways
produces inconsistent results:
> Sys.date()
[1] "2006-09-01"
> as.POSIXct(Sys.Date())
[1] "2006-09-01 02:00:00 CEST"
> a