human
get the date from a string.
assistant
Here is a Python code to get the date from a string

import datetime

def get_date(date):
    """Get the date from a string."""
    return datetime.datetime.strptime(date, "%Y-%m-%d")

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

# Calling the function
print((get_date(date)))

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

#Remember to inspect code for bugs.