from datetime import datetime datum = datetime.strptime('12.12.2002 05:45', '%d.%m.%Y %M:%H') print(datum)