def _ensure_datetime_to_string(maybe_dttm):
if isinstance(maybe_dttm, datetime.datetime):<EOL><INDENT>maybe_dttm = _format_datetime(maybe_dttm)<EOL><DEDENT>return maybe_dttm<EOL>
If maybe_dttm is a datetime instance, convert to a STIX-compliant
    string representation.  Otherwise return the value unchanged.