from datetime import datetime


def mkdate(date_string):
    """
    Define date/month string

    Parameters
    ----------
    date_string : string
        Date information in the filename

    Returns
    -------
    datetime : datetime.datetime object
        datetime object created from a string

    """
    if len(date_string) == 10:
        return datetime.strptime(date_string, '%Y-%m-%d')
    if len(date_string) == 16:
        return datetime.strptime(date_string, '%Y-%m-%dT%H:%M')