I'm using R 3.4.0
on Windows 7.
R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
When I am using strptime
/as.POSIXct
with a %z
offset that is larger than +1200
the return is NA
:
> strptime("2017-02-02 13:00:00 +1300", format="%Y-%m-%d %H:%M:%S %z")
[1] NA
> as.POSIXct("2017-02-02 13:00:00 +1300", format="%Y-%m-%d %H:%M:%S %z")
[1] NA
This has been asked before (as.POSIXct rejects +1300 timezone) and the bug was supposedly fixed in R 3.1.0.
I wonder whether anybody else still has the same issue and whether it might be Windows specific? I tested this in different R
version from 3.3.1
to 3.4.1
on Windows 7, 8, and 10 and got the same return.
The usual way without %z
but with the correct timezone tz
works:
> strptime("2017-02-02 13:00:00", format="%Y-%m-%d %H:%M:%S", tz = "NZ")
[1] "2017-02-02 13:00:00 NZDT"