I have a date stored in a string as:
date = '26 March 2018'
I'm trying to convert it to a datetime object with the following code:
date_element2 = datetime.strptime(date, '%d, %B, %Y')
But I'm getting the following traceback error:
ValueError: time data '26 March 2018' does not match format '%d, %B, %Y'
I can't figure out for the life of me how the formatting is incorrect, any help would be appreciated.
Thanks,
'%d, %B, %Y'should be like'%d %B %Y'