convertTZ: Convert a Timestamp from one Timezone to Another

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Convert a timestamp from one timezone to another.

Usage

1
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

1
2
3
4
5
6
7
8
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")

datetimeutils documentation built on March 18, 2018, 2:30 p.m.