Change timezone in a POSIXct object

It doesn’t work with POSIXct because base::as.POSIXct.default simply returns x if it’s already POSIXct. You can change the timezone via the tzone attribute:

attr(data$dateTime, "tzone") <- "Europe/Paris"

Leave a Comment