I'm using this code to get the time from lines in a file.
for line in f:
try:
dt = parser.parse(line).replace(tzinfo=None)
print dt
except Exception, e:
print line
print(traceback.format_exc())
continue
Traceback (most recent call last):
File "./script.py", line 90, in read
dt = parser.parse(line).replace(tzinfo=None)
AttributeError: 'ArgumentParser' object has no attribute 'parse'