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)); //源代码片段来自云代码http://yuncode.net