def globify_time_descriptors(path):
    """Convert strftime time descriptors to a glob-compatible expression.

    For example, convert,'%Y' to '[12][0-9][0-9][0-9]'. Then the
    glob expression can be used to match path names containing
    a four digit year.
    """

    path = path.replace('%Y', '[12][0-9][0-9][0-9]')
    path = path.replace('%y', '[0-9][0-9]')
    path = path.replace('%m', '[01][0-9]')
    path = path.replace('%d', '[0-3][0-9]')
    path = path.replace('%H', '[0-2][0-9]')
    path = path.replace('%M', '[0-5][0-9]')
    path = path.replace('%S', '[0-5][0-9]')
    return path