time data ‘May 10 2021’ does not match format ‘%m %d %Y’

I know this question has been asked alot of times but i cannot find a solution where the month is not in numerals.

This is my code:

date_time_str = 'May 10 2021'
date_time_obj = datetime. strptime(date_time_str, '%m %d %Y')
print("The type of the date is now", type(date_time_obj))```

This is the error:
ValueError: time data 'May 10 2021' does not match format '%m %d %Y'


Read more here: https://stackoverflow.com/questions/67930622/time-data-may-10-2021-does-not-match-format-m-d-y

Content Attribution

This content was originally published by Shangx at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: