def cal_proximity_correlation(evt1, evt2):
    """
    Function to calculate proximity between two events according to their timestamp values.

    :param evt1: event 1
    :param evt2: event 2
    :return: value between 0 to 1, 0 means huge time difference, 1 means they happened at the same time.
    """

    if 'time:timestamp' not in evt1 or 'time:timestamp' not in evt2:
        return 0.0
    time1 = evt1['time:timestamp']
    time2 = evt2['time:timestamp']
    if time1 is not None and time2 is not None:
        time1 = time1.timestamp()*1000
        time2 = time2.timestamp()*1000
        if time1 != time2:
            return 1.0 / (time2 - time1)
        else:
            return 1.0
    else:
        return 0.0