def cmp_rcsdates(date1, date2):
    """
    Compares two RCS dates. Accounts for RCS dates being of the form
    YY.mm.dd.HH.MM.SS before 2000 and YYYY.mm.dd.HH.MM.SS afterwards.

    """
    dates = [date1, date2]
    for i, date in enumerate(dates):
        if len(date) == 17:
            dates[i] = '19' + date
    return min(dates)