Change timezone in a POSIXct object
In the lubridate
package there is a function with_tz
which changes the timezone attribute (effectively what Joshua described).
dttm <- as.POSIXct("2016-01-01 10:10:10", tz = "UTC")dttm[1] "2016-01-01 10:10:10 UTC"
Change timezone from UTC
to CET
with_tz(dttm, "CET")[1] "2016-01-01 11:10:10 CET"