with_tz | R Documentation |
with_tz returns a date-time as it would appear in a different time zone.
The actual moment of time measured does not change, just the time zone it is
measured in. with_tz defaults to the Universal Coordinated time zone (UTC)
when an unrecognized time zone is inputted. See Sys.timezone()
for more information on how R recognizes time zones.
with_tz(time, tzone = "", ...)
## Default S3 method:
with_tz(time, tzone = "", ...)
time |
a POSIXct, POSIXlt, Date, chron date-time object or a data.frame
object. When a data.frame all POSIXt elements of a data.frame are processed
with |
tzone |
a character string containing the time zone to convert to. R must recognize the name contained in the string as a time zone on your system. |
... |
Parameters passed to other methods. |
a POSIXct object in the updated time zone
force_tz()
x <- ymd_hms("2009-08-07 00:00:01", tz = "America/New_York")
with_tz(x, "GMT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.