R strptime/as.POSIXct 中的未知时区名称 [英] unknown timezone name in R strptime/as.POSIXct
问题描述
在哪里可以找到 R 函数 as.POSIXct
的所有合法时间名称的列表?
Where can I find a list of all legal time names for R function as.POSIXct
?
as.POSIXct("1970-01-01",tz="CST")
生成CST"(中央标准时间)未知的警告.
as.POSIXct("1970-01-01",tz="CST")
generates a warning that "CST" (Central Standard Time) is unknown.
推荐答案
?Sys.timezone
有一些提示,具体看:"R_HOME/share/zoneinfo/zone.tab"
(R_HOME
是 R 的安装目录).请记住,时区是令人讨厌的,它们的许多细微差别都是特定于操作系统(和语言环境?)的.
?Sys.timezone
has some hints, specifically to look in: "R_HOME/share/zoneinfo/zone.tab"
(R_HOME
is the directory R is installed in). Keep in mind that time zones are nasty and many of their nuances are operating system (and locale?) specific.
在您的特定情况下,您需要 "CST6CDT"
而不是 "CST"
.
In your specific case, you want "CST6CDT"
instead of "CST"
.
这篇关于R strptime/as.POSIXct 中的未知时区名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!