获取前几天的当前时刻的时间方法 Calendar cal = Calendar.getInstance(); Date date = new Date();// 获取当前时间 cal.setTime(date); cal.set(Calendar.DATE,cal.get(Calendar.DATE)-1 );// 设置时间为前一天 DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.print…
public static List getWeekendInMonth(int year, int month) { List list = new ArrayList(); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year);// 不设置的话默认为当年 calendar.set(Calendar.MONTH, month - 1);// 设置月份 calendar.set(Calendar…