Datetime strptime issue with a timezone offset with colons
问题 Currently we are working on an application which is trying to calculate the travel time of a route from a to b, using the 2.db.transport.rest API. Unfortunatly we are receiving timestamps with a timezone offset from that API, such as +01:00 . What we need is a timezone offset without the : , so +0100 . The following example gives an error on Linux, using Python 3.6.7: from datetime import datetime datetimestring = "2019-01-19T15:13:00.000+01:00" datetime.strptime(datetimestring, '%Y-%m-%dT%H: