|
|
|
@ -446,6 +446,22 @@ public class DateUtils { |
|
|
|
return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 获取指定 月份的前n月 返回yyyyMM |
|
|
|
* @Param beforeMonth |
|
|
|
* @Param monthId |
|
|
|
* @author zxc |
|
|
|
* @date 2021/7/9 2:44 下午 |
|
|
|
*/ |
|
|
|
public static String getBeforeNMonthByMonth(int beforeMonth, String monthId){ |
|
|
|
StringBuilder builder = new StringBuilder(monthId); |
|
|
|
builder.insert(NumConstant.FOUR,"-"); |
|
|
|
builder.insert(builder.length(),"-01"); |
|
|
|
LocalDate parse = LocalDate.parse(builder.toString()); |
|
|
|
LocalDate localDate = parse.minusMonths(beforeMonth); |
|
|
|
return localDate.toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return java.util.List<java.lang.String> 返回yyyyMMdd |
|
|
|
* @param startTime yyyyMMdd |
|
|
|
|