def cmp_iso(a,b):
    """ Compares two iso8601 format dates. returns [0 : a = b], [-1 : a < b], [1 : a > b] """
    y0,y1 = int(a[:4]),int(b[:4])
    if y0 != y1: return -1 if y0 < y1 else 1
    m0,m1 = int(a[5:7]),int(b[5:7])
    if m0 != m1: return -1 if m0 < m1 else 1
    d0,d1 = int(a[8:10]),int(b[8:10])
    if d0 != d1: return -1 if d0 < d1 else 1
    H0,H1 = int(a[11:13]),int(b[11:13])
    if H0 != H1: return -1 if H0 < H1 else 1
    M0,M1 = int(a[14:16]),int(b[14:16])
    if M0 != M1: return -1 if M0 < M1 else 1
    S0,S1 = int(a[17:19]),int(b[17:19])
    return 1 if S0 > S1 else -1 if S0 < S1 else 0