convert_tz {datetimeutils}R Documentation

Convert a Timestamp from one Timezone to Another

Description

Convert a timestamp from one timezone to another.

Usage

convert_tz(datetime, from = "", to)

Arguments

datetime

character: YYYY-MM-DD HH:MM:SS

from

the timezone of datetime. If "", the local timezone is used.

to

to timezone to which datetime should be converted

Details

See timezones.

Be careful: if the specified timezone does not exist on your system, the function will not return an error.

Value

POSIXct

Author(s)

Enrico Schumann

References

B.D. Ripley and K. Hornik. Date-Time Classes. R-News, 1(2):8–12, 2001.

See Also

POSIXct

Examples


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")



[Package datetimeutils version 0.6-4 Index]