def _(obj):
    """ISO 8601 format. Interprets naive datetime as UTC with zulu suffix."""

    tz_offset = obj.utcoffset()

    if not tz_offset or tz_offset == UTC_ZERO:
        iso_datetime = obj.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
    else:
        iso_datetime = obj.isoformat()

    return iso_datetime
ISO 8601 format. Interprets naive datetime as UTC with zulu suffix.