def compare_gpstime(g0, g1):
    """
    Returns the index of the earlier GPSTIME (wn,tow) tow.
    """
    if g0[0] < g1[0]:
        return 0
    elif g0[0] > g1[0]:
        return 1
    elif g0[1] < g1[1]:
        return 0
    elif g0[1] > g1[1]:
        return 1
    else:
        return 0
