Short answer:
as.POSIXct(0, origin = ISOdatetime(1970,1,1,10,0,0, tz = "GMT"))
Long answer -- as.POSIXct goes through a somewhat crazy chain of
method dispatch to work, and only sometimes cares about the tz
argument.
For your case
as.POSIXct(x) -- calls -->
as.POSIXct.numeric(x) -- calls -->
The following three calls all produce the same result (my machine is in EST):
> as.POSIXct(0, tz="", origin=ISOdatetime(1970,1,1,10,0,0))
[1] "1970-01-01 10:00:00 EST"
> as.POSIXct(0, tz="EST", origin=ISOdatetime(1970,1,1,10,0,0))
[1] "1970-01-01 10:00:00 EST"
> as.POSIXct(0, tz="GMT", origin=IS
2 matches
Mail list logo