Given a string in xsd:dateTime format I want to create a python datetime object.
I especially need to be able to parse for example a string like this ‘2012-09-23T09:55:00’, but also all other defined examples should be parsed correctly, and also use timezones.
Given a string in xsd:dateTime format I want to create a python datetime object.
Share
Use the
datetime.datetime.strptimeclass method to parse these:Your example does not include a timezone however. If you really do need timezone support, best resort to the
python-dateutilmodule: