def CombineTimeList(TimeList):
    newTimeList = []
    TimeList.sort()
    stime = TimeList[0][0]
    etime = TimeList[0][1]
    for i in range(1, len(TimeList), 1):
        if (TimeList[i][1] <= etime):
            continue
        elif (TimeList[i][0] <= etime <= TimeList[i][1]):
            etime = TimeList[i][1]
        elif (TimeList[i][0] > etime):
            newTimeList.append([stime, etime])
            stime = TimeList[i][0]
            etime = TimeList[i][1]
    newTimeList.append([stime, etime])
    return newTimeList
def CombineTimeList(TimeList):
    newTimeList = []
    TimeList.sort()
    stime = TimeList[0][0]
    etime = TimeList[0][1]
    for i in range(1, len(TimeList), 1):
        if (TimeList[i][1] <= etime):
            continue
        elif (TimeList[i][0] <= etime <= TimeList[i][1]):
            etime = TimeList[i][1]
        elif (TimeList[i][0] > etime):
            newTimeList.append([stime, etime])
            stime = TimeList[i][0]
            etime = TimeList[i][1]
    newTimeList.append([stime, etime])
    return newTimeList