Here you can find the source of getWeekBegin(Date date)
public static Date getWeekBegin(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getWeekBegin(Date date) { if (date == null) { return null; }//from ww w . j ava 2 s . c om Calendar cal = new GregorianCalendar(); cal.setTime(date); int dw = cal.get(Calendar.DAY_OF_WEEK); while (dw != Calendar.MONDAY) { cal.add(Calendar.DATE, -1); dw = cal.get(Calendar.DAY_OF_WEEK); } return cal.getTime(); } public static Date getWeekBegin(Calendar calendar) { if (calendar == null) { return null; } Calendar date = new GregorianCalendar(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); int dw = date.get(Calendar.DAY_OF_WEEK); while (dw != Calendar.MONDAY) { date.add(Calendar.DATE, -1); dw = date.get(Calendar.DAY_OF_WEEK); } return date.getTime(); } }