Valid time zones in lubridate

那年仲夏 提交于 2019-12-30 07:55:07

问题


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)

回答1:


Take a search through OlsonNames() 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.



来源:https://stackoverflow.com/questions/29784310/valid-time-zones-in-lubridate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!