Here you can find the source of getPreWeekLastDay()
public static Date getPreWeekLastDay()
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getPreWeekLastDay() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.setFirstDayOfWeek(1);//from w w w .ja v a 2s . c o m int week = calendar.get(Calendar.DAY_OF_WEEK); int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), day + 1 - week); return calendar.getTime(); } }