import time
import calendar


def convert_date(value, date_format="%Y-%m-%dT%H:%M:%S"):
    """convert UTC formatted timestamp to epoch value

    Args:
        value ([str]): [UTC formatted timestamp]

    Returns:
        [number]: [Epoch value]
    """
    if not value:
        return value

    # Sentinel can return 7 millisecond characters which time.strptime cannot parse
    # strip milliseconds as 7 characters cannot be parsed by %f
    utc_time = time.strptime(value[:value.rfind('.')], date_format)
    return calendar.timegm(utc_time)*1000