// 获得当前月--结束日期
public String getMaxMonthDate(String date) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(dateFormat.parse(date));
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return dateFormat.format(calendar.getTime());
} catch (java.text.ParseException e) {
e.printStackTrace();
}
return null;
}
获得当前月--结束日期
最新推荐文章于 2023-01-03 14:50:42 发布