I am using Python 3.6.2 and am trying to convert this string using time.strptime
:
2017-08-07 07:09:31.024719+00:00
which is returned from Active Directory from a query using the ldap3 module.
I issue the following commands:
from time import strptime
strptime('2017-08-07 07:09:31.024719+00:00', '%Y-%m-%d %H:%M:%S.%f%z')
And I get:
ValueError: time data '2017-08-07 07:09:31.024719+00:00' does not match format '%Y-%m-%d %H:%M:%S.%f%z'
According to the documentation, I believe this should work? Also, I intend to add an offset and to this using timedelta and then displaying it to the user in a console.
I've done this in python shell and it seems to solve your problem, if +00:00 meens UTC.
It returns: