def _convert(type: str, date: str) ->int:
    """Convert dates to int representations."""
    res = None
    if type == 'month':
        res = int(date.format('YYYYMM'))
    elif type == 'day':
        res = int(date.format('YYYYMMDD'))
    elif type == 'hour':
        res = int(date.format('YYYYMMDDHH'))
    return res
