def date_to_numerical(date):
    """convert date string to a number for chronological sorting.

    Returns:
        value = year * 2000  + month * 100 + date
        the last two decimal digits are reserved for dates.
        The middle two digits will have months values 1 ~ 12.
        year * 2000 is garanteed to have value larger than
        month * 100.
    """
    month_val = int(date[0:2])
    date_val = int(date[2:4])
    year_val = int(date[4:8])
    return year_val * 2000 + month_val * 100 + date_val