I am trying to convert this string into date format:
import datetime
my_string = "202206051234555555"
convert_date = datetime.datetime.strptime(my_string, "%Y%M%d%H%M%S")
I am getting this error:
re.error, redefinition of group name 'M' as group 5; was group 2
Can someone help in converting this string type to date? I want only date and I dont want time at the end.