def format_date(date):
    """Return ISO 8601 date string for `date`

    Uses format `YYYY-MM-DDThh:mm:ss.sTZD`

    Parameters
    ----------
    date : datetime
        Date to format

    Returns
    -------
    str
        ISO 8601 formatted date string
    """
    return (date.strftime('%Y-%m-%dT%H:%M:%S')
            + date.strftime('.%f')[:4] + 'Z')