/**
* 获取本周的第一天
* @return String
* **/
public static String getWeekStart(){
Calendar cal=Calendar.getInstance();
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setTime(new java.util.Date());
cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek()); // Monday
java.util.Date time=cal.getTime();
return new SimpleDateFormat("yyyy-MM-dd").format(time)+" 00:00:00";
}
/**
* 获取本周的最后一天
* @return String
* **/
public static String getWeekEnd(){
Calendar cal=Calendar.getInstance();
cal.setFirstDayOfWeek(Calendar.MONDAY);
cal.setTime(new java.util.Date());
cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek() + 6); // Sunday
java.util.Date time=cal.getTime();
return new SimpleDateFormat("yyyy-MM-dd").format(time)+" 23:59:59";
}