def datetime_from_iso8601(value):
    try:
        try:
            return aniso8601.parse_datetime(value)
        except ValueError:
            date = aniso8601.parse_date(value)
            return datetime(date.year, date.month, date.day)
    except:
        raise ValueError('Invalid date literal "{0}"'.format(value))
Turns an ISO8601 formatted date into a datetime object.
dataset/ETHPy150Open noirbizarre/flask-restplus/flask_restplus/inputs.py/datetime_from_iso8601