dateutil icon indicating copy to clipboard operation
dateutil copied to clipboard

incorrectly parsing timezone in ISO format timezone: UTC+8:00 UTC-8:00

Open wjo1212 opened this issue 7 years ago • 1 comments

dig into the object, found the timezone parsed is incorrectly identified for UTC+HH:MM UTC+8:00 is identified as timezone UTC-8:00 is it a known issue?

from dateutil import parser
def p(tm):
    dt = parser.parse(tm)
    dt.timestamp()

print(p('2019-01-14 11:13:09 UTC+8:00'))   #  1547493189  should be 1547435589
print(p('2019-01-14 11:13:09 UTC-8:00'))   #   1547435589 should be 1547493189

refer to http://timestamp.online/

wjo1212 avatar Jan 14 '19 04:01 wjo1212

i found it works for 2019-01-14 11:13:09+8:00, close it. now

wjo1212 avatar Jan 14 '19 06:01 wjo1212