0

I am trying to use datetime.strptime but I keep getting the following Error:

ValueError: time data 'Wed Mar 04 14:37:52 EET 2015' does not match format '%a %b %d %H:%M:%S %Z %Y'

I've tried with my usual locale (de_DE.UTF-8) and I tried switching to en_US.UTF-8, but that didn't seem to have any effect.

Any ideas why it wouldn't parse?

Klaus
  • 1
  • 2
    Python 2 doesn't support parsing timezone abbreviations. – Martijn Pieters Mar 10 '15 at 11:55
  • According to this it does: https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior or have I misunderstood the %Z description? – Klaus Mar 10 '15 at 12:18
  • It can *output* the abbreviated timezone, but parsing it fails, mostly because the required timezone database is not part of Python. Python 3 supports parsing timezone *offsets*, but still not timezone names. – Martijn Pieters Mar 10 '15 at 12:27
  • Oh. Not quite the answer I was hoping for, but thanks for the help! – Klaus Mar 12 '15 at 10:58

0 Answers0