from datetime import datetime


def parse_date(date):
    """
    Returns a datetime object from a string input.
    """
    if date is not None:
        day, month, year = date.split("-")
        day, month, year = int(day), int(month), int(year)
        return datetime(year, month, day)
    else:
        return None