Skip to content

Instantly share code, notes, and snippets.

@greggyNapalm
Created June 10, 2013 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggyNapalm/5747514 to your computer and use it in GitHub Desktop.
Save greggyNapalm/5747514 to your computer and use it in GitHub Desktop.
>>> from datetime import datetime
>>> s = '[07/Jun/2013:04:48:36 +0400]'
>>> datetime.strptime(s, '[%d/%b/%Y:%H:%M:%S %z]')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 317, in _strptime
(bad_directive, format))
ValueError: 'z' is a bad directive in format '[%d/%b/%Y:%H:%M:%S %z]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment