/**
* 判断一年的第几周
* @param datetime
* @return
* @throws java.text.ParseException
*/
public static Integer whatWeek(String datetime) throws java.text.ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = format.parse(datetime);
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
Integer weekNumbe = calendar.get(Calendar.WEEK_OF_YEAR);
return weekNumbe;
}
默认周日为1,依次往后排列