获取今后多少天后的日期
@SuppressLint("SimpleDateFormat")
private static String getClosingDate(int year, int month, int day) {
final int internalDay = 31;
final String pattern = "yyyy-MM-dd";
DateFormat dateFormat = new SimpleDateFormat(pattern);
Date closingDate;
try {
Calendar thisDay = Calendar.getInstance();
thisDay.set(Calendar.YEAR, year);
thisDay.set(Calendar.MONTH, month - 1);
thisDay.set(Calendar.DAY_OF_MONTH, day);
thisDay.add(Calendar.DAY_OF_MONTH, internalDay);
closingDate = thisDay.getTime();
} catch (Exception e) {
e.printStackTrace();
return null;
}
return dateFormat.format(closingDate);
}