def datetime_to_iso(date):
    """
    convert a datetime object to an ISO_8601 formatted string. Format of string
    is taken from JS date to string
    """
    return date.strftime('%Y-%m-%dT%H:%M:%S.%fZ')