Skip to content
Prev 21767 / 63424 Next

Date conversion with as.POSIXct and as.POSIXlt (PR#9196)

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 in the local timezone.

I've expanded the documentation, but I see no sign you had studied it so 
that it unlikely to help you.
On Fri, 1 Sep 2006, erich.neuwirth at univie.ac.at wrote: