Information about time zones in R. Sys.timezone returns the name of the current time zone.
Sys.timezone(location = TRUE)<p></p><p>OlsonNames(tzdir = NULL)</p>
| Parameter | Description |
|---|---|
location |
logical: defunct: ignored, with a warning for false values. |
tzdir |
The time-zone database to be used: the default is to try known locations until one is found. |
# NOT RUN {
Sys.timezone()
str(OlsonNames()) ## typically close to 600 hundred names,
## typically some acronyms/aliases such as "UTC", "NZ", "MET", "Eire", ..., but
## mostly pairs (and triplets) such as "Pacific/Auckland"
table(sl <- grepl("/", OlsonNames()))
OlsonNames()[ !sl ] # the simple ones
head(Osl <- strsplit(OlsonNames()[sl], "/"))
(tOS1 <- table(vapply(Osl, `[[`, "", 1))) # Continents, countries, ...
table(lengths(Osl))# most are pairs, some triplets
str(Osl[lengths(Osl) >= 3])# "America" South and North ...
# }