def warc_datetime_str(date):
    """Amendedment to warctools' function to fix non-ISO8601 output."""
    iso = date.isoformat()
    if "." in iso:
        iso = iso[:iso.find(".")]
    if "+" in iso:
        iso = iso[:iso.find("+")]
    return iso + "Z"