1

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"
jodis
  • 158
  • 1
  • 8
  • I agree, and it is windows-only (your command works on R-3.3.3/x86_64-pc-linux-gnu). And to paraphrase a comment in your linked question: "it is a (windows-specific) bug, and [worth reporting](https://bugs.r-project.org/bugzilla/enter_bug.cgi)". – r2evans Jun 30 '17 at 08:00
  • Thanks. Unfortunately, Bugzilla is closed to new members, so I have to figure out how to report this. – jodis Jul 02 '17 at 23:34

0 Answers0