首页 文章

无法在as.POSIXct函数中设置时区

提问于
浏览
0
Sys.timezone()

[1]“CST”

as.POSIXct("2012-12-12",tz="CST")

[1]“2012-12-12 GMT”

有13个警告(使用警告()来查看它们)

我已将tz设置为CST,但输出为GMT,带有警告消息,出了什么问题?

编辑:

我的操作系统是Windows 7

警告是:

Warning messages:
1: In strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) : unknown timezone 'CST'
2: In as.POSIXct.POSIXlt(x) : unknown timezone 'CST'
3: In strptime(xx, f <- "%Y/%m/%d %H:%M:%OS", tz = tz) : unknown timezone 'CST'
4: In as.POSIXct.POSIXlt(x) : unknown timezone 'CST'
5: In strptime(xx, f <- "%Y-%m-%d %H:%M", tz = tz) : unknown timezone 'CST'
6: In as.POSIXct.POSIXlt(x) : unknown timezone 'CST'
7: In strptime(xx, f <- "%Y/%m/%d %H:%M", tz = tz) : unknown timezone 'CST'
8: In as.POSIXct.POSIXlt(x) : unknown timezone 'CST'
9: In strptime(xx, f <- "%Y-%m-%d", tz = tz) : unknown timezone 'CST'
10: In as.POSIXct.POSIXlt(x) : unknown timezone 'CST'
11: In strptime(x, f, tz = tz) : unknown timezone 'CST'
12: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) :
  unknown timezone 'CST'
13: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'CST'

2 回答

相关问题