Skip to content
Prev 44823 / 63424 Next

Date time conversion bug (as.POSIXct)?

On Jan 11, 2013, at 5:12 AM, Dries Verheyen wrote:

            
It works perfectly fine the way it's supposed to - you just give it wrong input. What you get from as.numeric(...) is the offset from the epoch (1970-01-01 GMT!) yet you are then forcing as.POSIXct to interpret it as offset from the local time zone which is obviously wrong. I suppose what you really wanted is
[1] "2012-05-30 13:00:00 EST"

The problem in your case is that you want to have origin in a different timezone than the result which is a bit convoluted.

Cheers,
Simon