SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH,
cal.getActualMinimum(Calendar.DAY_OF_MONTH));
String beforeMonth = sdf.format(cal.getTime());
return beforeMonth;
UtilDate(四)获取前月1号日期
最新推荐文章于 2022-05-23 20:23:45 发布