Here you can find the source of getWeekFirstDay(Date weekday)
public static Date getWeekFirstDay(Date weekday)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Date getWeekFirstDay(Date weekday) { Calendar cal = Calendar.getInstance(); cal.setTime(weekday);//from ww w. j ava 2s . com if (cal.get(cal.DAY_OF_WEEK) == 1) {//sunday cal.add(cal.DATE, -6); } else { cal.add(cal.DATE, 2 - cal.get(cal.DAY_OF_WEEK)); } return cal.getTime(); } }