from datetime import datetime


def str_to_time(ds):
    """
    Convert a date string to a datetime object

    Input:
        ds: date string, e.g., 2019-01-03
    """
    return datetime.strptime(ds, "%Y-%m-%d %H:%M:%S")