java获取本月开始的一天与最后一天
/** * 获取本月第一天 * @return */ public Date getmindate(){ Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); return calendar.getTime(); } /** * 获取本月最后一天 * @return */ public Date getmaxdate(){ Calendar calendar2 = Calendar.getInstance(); calendar2.setTime(new Date()); calendar2.set(Calendar.DAY_OF_MONTH, calendar2.getActualMaximum(Calendar.DAY_OF_MONTH)); return calendar2.getTime(); }