# Single timezone
x <- as.POSIXct("2025-05-10 12:00:00", tz = "UTC")
with_localtime(x, "Europe/Brussels")
# Multiple timezones
times <- as.POSIXct(c("2025-05-10 12:00:00", "2025-05-10 12:00:00"), tz = "UTC")
tzs <- c("Europe/Brussels", "America/New_York")
# Times not appear to be in UTC, but the values are in their local time zone.
with_localtime(times, tzs)
Run the code above in your browser using DataLab