as.POSIXct rejects +1300 timezone

喜夏-厌秋 提交于 2019-12-12 10:59:13

问题


I'm using as.POSIXct to parse times with timezones, like this:

as.POSIXct("2009-01-05 14:19 +1200", format="%Y-%m-%d %H:%M %z")

However, if the string includes the timezone information +1300, the function returns NA:

> as.POSIXct("2009-01-05 14:19 +1300", format="%Y-%m-%d %H:%M %z")
[1] NA

Aparently +1300 is a valid timezone (NZDT – New Zealand Daylight Time). How to convince R to parse it?


回答1:


This was a bug in 3.0.2 release, which was fixed in R-3.1.0 Patched build.



来源:https://stackoverflow.com/questions/23182569/as-posixct-rejects-1300-timezone

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