起始月份结束月份计算范围
moon_list_title = [] moonlist = [] for item in range(int(split_start[1]), int(split_end[1]) + 1): day_num = calendar.monthrange(int(split_end[0]), int(item)) moon_list_title.append(str(split_start[0]) + "-" + str(item) + "月") year = "0" + str(item) if len(str(item)) < 2 else str(item) moonlist.append( (str(split_start[0]) + "-" + str(year) + "-" + "01 00:00:00", str(split_start[0]) + "-" + str(year) + "-" + str(day_num[1]) + " 23:59:59") )