java获得上周星期日的日期

public static Date getLastWeekSunday(){

    Calendar date=Calendar.getInstance(Locale.CHINA);

    date.setFirstDayOfWeek(Calendar.MONDAY);//将每周第一天设为星期一,默认是星期天

    date.add(Calendar.WEEK_OF_MONTH,-1);//周数减一,即上周

    date.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);//日子设为星期天

    return date.getTime();

}