def months_interval(start_date, end_date):
    """
    Generate the monthly intervals between a start date and an end date
    """
    months_num = [str(i+1).zfill(2) for i in range(12)]
    start_year = int(start_date[0:4])
    start_month = int(start_date[4:6])
    end_year = int(end_date[0:4])
    end_month = int(end_date[4:6])
    if start_year==end_year:
        return [str(start_year)+str(month).zfill(2) for month in range(start_month ,end_month+1)]
    else:
        months_in_start_year = [str(start_year)+str(month).zfill(2) for month in range(start_month ,13)]
        months_in_end_year = [str(end_year)+str(month).zfill(2) for month in range(1,end_month+1)]
        months_in_between = [str(year) + month for year in range(start_year+1, end_year) for month in months_num ]
        return months_in_start_year + months_in_between + months_in_end_year