Hello @ pagarsach,
You can convert a string to date object using the strptime function.
Provide the date string and the format in which the date is specified.
Example:
import datetime
date_str = '30062020' # The date - 30 Jun 2020
format_str = '%d%m%Y' # The format
datetime_obj = datetime.datetime.strptime(date_str, format_str)
print(datetime_obj.date())
Output
This will give the output −
30-06-2020
Hope it helps!!
Thank You!!