src/main/java/com/hx/util/DateUtil.java
@@ -755,4 +755,15 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA); return sdf.format(calendar.getTime()); } /** * 获取时间当月剩余天数 * */ public static Integer getMonthSurplus(Date date) { Calendar month = Calendar.getInstance(); month.setTime(new Date()); month.set(Calendar.DATE, 1); month.roll(Calendar.DATE, -1); return month.getActualMaximum(Calendar.DATE) - Calendar.getInstance().get(Calendar.DAY_OF_MONTH); } }