import time


def compare_time(origin_time, new_time,tweet_type=None):
    """
    compare old time de new time.
    :param origin_time: the time in dataFrame before updated.
    :param new_time: the new time that a new tweet posted.
    :return: the bigger one between origin_time and new_time.
    """
    temp_origin_time = time.mktime(time.strptime(origin_time, '%Y-%m-%dT%H:%M:%S.000Z'))
    temp_new_time = time.mktime(time.strptime(new_time, '%Y-%m-%dT%H:%M:%S.000Z'))
    if temp_new_time >= temp_origin_time:
        return new_time
    else:
        return origin_time