Python format a string date to actual format gives me error [closed]

Code:

date_format_str = "%Y-%d-%m %H:%M:%S%z"
starttime = datetime.strptime(startdate, date_format_str)

Error:

ValueError: time data '2022-12-20 10:18:00+00:00' does not match format '%Y-%d-%m %H:%M:%S%z'
Back to Top