A quick google search seems to get me nowhere. What are valid time zones in lubridate's tz
option? In particular, am looking for Brasilia's time zone. Thanks!
library(lubridate)
dts <- c("6-3-1995 12:01:01","29-3-1995 23:01:01","29-3-1995 20:01:01")
dmy_hms(dts) # locale's tz default
dmy_hms(dts, tz = "chile") # Chilean time (has one time zone only)
tz returns a date's time zone attribute. When used as a settor, it changes the time zone attribute. R does not come with a predefined list zone names, but relies on the user's OS to interpret time zone names. As a result, some names will be recognized on some computers but not others.
According to the help pages: force_tz returns a date-time that has the same clock time as x in the new time zone. with_tz changes the time zone in which an instant is displayed. The clock time displayed for the instant changes, but the moment of time described remains the same.
Take a search through the OlsonNames()
in the standard base
R package, which provides a list of all the valid timezones on the host system. e.g.:
grep("Brazil", OlsonNames(), value=TRUE)
...provides four possible results for Brazil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With