x <- y <- ymd_hms("2012-03-26 10:10:00", tz = "UTC")
tz(x)
# Note that setting tz() preserved the clock time, which implies
# that the actual instant in time is changing
tz(y) <- "Pacific/Auckland"
y
x - y
# This is the same as force_tz()
force_tz(x, "Pacific/Auckland")
# Use with_tz() if you want to change the time zone, leave
# the instant in time the same
with_tz(x, "Pacific/Auckland")
Run the code above in your browser using DataLab