from datetime import datetime


def str_to_datetime(time: str):
    """
    convert a string to a datetime. The format of the string is like "1980-12-30"
    :param time:
    :return:
    """
    return datetime.strptime(time, "%Y-%m-%d")