// 本月的第一天 Calendar calendar = new GregorianCalendar(); calendar.set( Calendar.DATE, 1 ); SimpleDateFormat simpleFormate = new SimpleDateFormat( " yyyy-MM-dd " ); System.out.println(simpleFormate.format(calendar.getTime())); // 本月的最后一天 Calendar calendar = new GregorianCalendar(); calendar.set( Calendar.DATE, 1 ); calendar.roll(Calendar.DATE, - 1 ); SimpleDateFormat simpleFormate = new SimpleDateFormat( " yyyy-MM-dd " ); System.out.println(simpleFormate.format(calendar.getTime()));