(values)
return cleaned
For a list of values, stringify the `date` and `datetime` values
    using strftime.
For a list of values, stringify the `date` and `datetime` values
    using strftime.
For a list of values stringify the date and datetime values using strftime .
def _serialize_datetime(values):
    """For a list of values, stringify the `date` and `datetime` values
    using strftime."""
    cleaned = []

    for v in values:
        if type(v) is datetime:
            # isinstance(datetime, date) will always return True, so
            # do a type comparison instead.
            cleaned.append(v.strftime("%Y-%m-%d %H:%M:%S"))
        elif type(v) is date:
            cleaned.append(v.strftime("%Y-%m-%d"))
        else:
            cleaned.append(v)

    return cleaned
def _serialize_datetime ( values ) : cleaned = [ ] for v in values : if type ( v ) is datetime : # isinstance(datetime, date) will always return True, so # do a type comparison instead. cleaned . append ( v . strftime ( "%Y-%m-%d %H:%M:%S" ) ) elif type ( v ) is date : cleaned . append ( v . strftime ( "%Y-%m-%d" ) ) else : cleaned . append ( v ) return cleaned