问题
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