日期:2014-05-20 浏览次数:20606 次
Calendar c = Calendar.getInstance(); c.setTime(new Date()) ; c.add(Calendar.MONTH, -1) ; //上个月 //c.add(Calendar.MONTH, 1) ; //下个月 int currDayCnt = c.getActualMaximum(Calendar.DAY_OF_MONTH) ; if (currDayCnt >= 30){ System.out.println(" >= 30") ; }else{ System.out.println(" < 30") ; }