R strptime/as.POSIXct 中的未知时区名称 [英] unknown timezone name in R strptime/as.POSIXct

查看:24
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆