获取某时间是星期几

public static int getWeekDay(java.util.Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		int weekday = cal.get(Calendar.DAY_OF_WEEK);
		return weekday == 1 ? 7 : weekday - 1;
	}

 

你可能感兴趣的:(时间)