Integrations/Elasticsearch_v2/Elasticsearch_v2.py
def format_to_iso(date_string):
    """Formatting function to make sure the date string is in YYYY-MM-DDThh:mm:ssZ format.

    Args:
        date_string(str): a date string in ISO format could be like: YYYY-MM-DDThh:mm:ss+00:00 or: YYYY-MM-DDThh:mm:ss

    Returns:
        str. A date string in the format: YYYY-MM-DDThh:mm:ssZ
    """
    if len(date_string) > 19 and not date_string.endswith('Z'):
        date_string = date_string[:-6]

    if not date_string.endswith('Z'):
        date_string = date_string + 'Z'

    return date_string
Formatting function to make sure the date string is in YYYY-MM-DDThh:mm:ssZ format.

    Args:
        date_string(str): a date string in ISO format could be like: YYYY-MM-DDThh:mm:ss+00:00 or: YYYY-MM-DDThh:mm:ss

    Returns:
        str. A date string in the format: YYYY-MM-DDThh:mm:ssZ
    
Formatting function to make sure the date string is in YYYY-MM-DDThh:mm:ssZ format.
Formatting function to make sure the date string is in YYYY - MM - DDThh : mm : ssZ format .
def format_to_iso(date_string):
    if len(date_string) > 19 and not date_string.endswith('Z'):
        date_string = date_string[:-6]
    if not date_string.endswith('Z'):
        date_string = date_string + 'Z'
    return date_string
def format_to_iso ( date_string ) : if len ( date_string ) > 19 and not date_string . endswith ( 'Z' ) : date_string = date_string [ : - 6 ] if not date_string . endswith ( 'Z' ) : date_string = date_string + 'Z' return date_string
Formatting function to make sure the date string is in YYYY-MM-DDThh:mm:ssZ format.
Formatting function to make sure the date string is in YYYY - MM - DDThh : mm : ssZ format .
"""Formatting function to make sure the date string is in YYYY-MM-DDThh:mm:ssZ format.

    Args:
        date_string(str): a date string in ISO format could be like: YYYY-MM-DDThh:mm:ss+00:00 or: YYYY-MM-DDThh:mm:ss

    Returns:
        str. A date string in the format: YYYY-MM-DDThh:mm:ssZ
    """
str. A date string in the format: YYYY-MM-DDThh:mm:ssZ
str . A date string in the format : YYYY - MM - DDThh : mm : ssZ
date_string
a date string in ISO format could be like: YYYY-MM-DDThh:mm:ss+00:00 or: YYYY-MM-DDThh:mm:ss
a date string in ISO format could be like : YYYY - MM - DDThh : mm : ss + 00 : 00 or : YYYY - MM - DDThh : mm : ss