def serialize_date(value):
    if not value:
        return None
    elif isinstance(value, datetime.date):
        return value.isoformat()
    elif isinstance(value, datetime.datetime):
        return value.date().isoformat()
    else:
        return parse_date(value).isoformat()
Attempts to convert `value` into an ``xs:date`` string. If `value` is
dataset/ETHPy150Open STIXProject/python-stix/stix/utils/dates.py/serialize_date