from datetime import datetime


def convert_date(measured_time):
    """
    Convert obtained from provider api date to correct for influxdb
    :param measured_time:
    :return: example - '2019-01-31T19:25:00Z'
    """
    converted_measured_time = datetime.strptime(measured_time, "%Y-%m-%d %H:%M:%S")
    return converted_measured_time.strftime("%Y-%m-%dT%H:%M:%SZ")