Bug 15768 - strptime() rejects +1300 time-zone offset
Summary: strptime() rejects +1300 time-zone offset
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R 3.0.2
Hardware: Other OS X Mavericks
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-04-21 16:11 UTC by Rodrigo Souza
Modified: 2014-04-23 08:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Souza 2014-04-21 16:11:13 UTC
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).

(previously reported at http://stackoverflow.com/questions/23182569/as-posixct-rejects-1300-timezone)
Comment 1 Brian Ripley 2014-04-23 08:25:30 UTC
+1300 is not a timezone: it is an offset (see the description of %z in ?strptime).  And the issue is not as.POSIXct but strptime: it was the third-party code use by strptime which does not recognize that offset.