java 返回上个月的最后一天
Calendar calendar = Calendar.getInstance(); int month = calendar.get(Calendar.MONTH); calendar.set(Calendar.MONTH, month-1); calendar.set(Calendar.DAY_OF_MONTH,calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); Date strDateTo = calendar.getTime(); System.out.println(formatter.format(strDateTo));