0

Actually i guess it is a easy question, but I could not find a answer for my datestring.

It is formated like this:

'2015-01-16T14:13:56+01:00'

I tried to parse it with:

datetime.datetime.strptime(timestring, "%Y-%m-%dT%H:%M:%SZ")
datetime.datetime.strptime(timestring, "%Y-%m-%dT%H:%M:%S+%Z")
datetime.datetime.strptime(timestring, "%Y-%m-%dT%H:%M:%S+HH:MM")

This seems to be wrong because it returns it does not match.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Igl3
  • 4,900
  • 5
  • 35
  • 69
  • Actually I need it for python 2.7. The linked duplicate question i already checked out, but doesn't work either. – Igl3 Jan 16 '15 at 13:48
  • a better duplicate would be [Convert timestamps with offset to datetime obj using strptime](http://stackoverflow.com/q/12281975/4279) – jfs Jan 16 '15 at 14:12
  • @J.F.Sebastian: golly, perhaps yes, now that I updated that answer to cover Python 3. – Martijn Pieters Jan 16 '15 at 15:22

0 Answers0