java获取过去12个月日期
/**
*
* @return 返回最近12个月的日期
*/
public static List<String> getLast12Months(){
ArrayList<String > latest12Months = new ArrayList<>(12);
LocalDate today = LocalDate.now();
for(long i = 11L;i >=0L; i--){
LocalDate localDate = today.minusMonths(i);
String ss = localDate.toString().substring(0,7);
latest12Months.add(ss);
}
return latest12Months;
}