from datetime import datetime, timedelta dt1 = datetime.strptime("17/02/2016 6:01:26 am(UTC-08:00)", "%d/%m/%Y %H:%M:%S %p(%Z%z)") > Traceback (most recent call last): File "<stdin>", line 1, in > <module> File "C:\Python27\lib\_strptime.py", line 317, in _strptime > (bad_directive, format)) ValueError: 'z' is a bad directive in format '%d/%m/%Y %H:%M:%S %p(%Z%z)' how to fix this issue?
%z: hg.python.org/cpython/file/tip/Lib/_strptime.py#l298from dateutil.parser import parse; parse("17/02/2016 6:01:26 am(UTC-08:00)".replace("(UTC"," ")[:-1])