from datetime import datetime


def string_to_iso_datetime(string):
    """
    if string == '' return today

    :param string: str
    :return: datetime.datetime
    """
    if string:
        return datetime.strptime(string.split('.')[0], "%Y-%m-%dT%H:%M:%S")
    else:
        return datetime.strptime(datetime.today().isoformat().split('T')[0], "%Y-%m-%d")