convert_tz | R Documentation |
Convert a timestamp from one timezone to another.
convert_tz(datetime, from = "", to)
datetime |
character: |
from |
the timezone of datetime. If |
to |
to timezone to which datetime should be converted |
See timezones
.
Be careful: if the specified timezone does not exist on your system, the function will not return an error.
POSIXct
Enrico Schumann
B.D. Ripley and K. Hornik. Date-Time Classes. R-News, 1(2):8–12, 2001.
POSIXct
convert_tz("2016-05-10 12:00:00",
"America/Chicago", "America/Chicago")
convert_tz("2016-05-10 12:00:00",
"Europe/Berlin", "America/Chicago")
convert_tz(Sys.time(), to = "Europe/London")
convert_tz(Sys.time(), to = "America/Chicago")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.