"GMT+1" is parsed as "GMT-1"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
New
|
Undecided
|
Unassigned |
Bug Description
When parsing timezones such as "GMT+1" (GMT plus one) the result is "GMT-1" (GMT minus one) and vice verca. Replacing "GMT" string with "UTC" shows same behaviour. However just "+1" or "-1" as timezone information works as expected.
Both dateutil versions 1.5 and 2.0 are affected by this issue.
>>> import dateutil.parser
>>> dateutil.
datetime.
# Parsed timezone offset should be +3600.
>>> dateutil.
datetime.
# Parsed timezone offset should be -3600.
>>> dateutil.
datetime.
# Parsed timezone offset is correct.
Parsing GTM+1 this way is actually a part of the Posix specification. This is therefore a feature, and not a bug.