from datetime import datetime date_string = "2021-09-01" date_object = datetime.strptime(date_string, "%Y-%m-%d") print(date_object)