human
how to parse string to date fromat in.
assistant
Here is a Python function to parse string to date fromat the date

import datetime

def parse_date(date_str):
    """Parse a date string to a datetime object.
    """
    return datetime.datetime.strptime(date_str, '%Y-%m-%d')

# Enter the date string
date_str = "2019-01-01"

# Calling the function
date = parse_date(date_str)

# Printing the result
print(date)

#Example Output
# 2019-01-01 00:00:00

#Remember to inspect code for bugs.