Here you can find the source of getFirstDayOfWeek(Date date)
public static Date getFirstDayOfWeek(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getFirstDayOfWeek(Date date) { Calendar c = new GregorianCalendar(); c.setFirstDayOfWeek(Calendar.MONDAY); c.setTime(date);/*from w w w . j ava 2 s . c o m*/ c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek()); return c.getTime(); } public static Date getFirstDayOfWeek(int year, int week) { Calendar calFirst = Calendar.getInstance(); calFirst.set(year, 0, 7); Date firstDate = getFirstDayOfWeek(calFirst.getTime()); Calendar firstDateCal = Calendar.getInstance(); firstDateCal.setTime(firstDate); Calendar c = new GregorianCalendar(); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, Calendar.JANUARY); c.set(Calendar.DATE, firstDateCal.get(Calendar.DATE)); Calendar cal = (GregorianCalendar) c.clone(); cal.add(Calendar.DATE, (week - 1) * 7); firstDate = getFirstDayOfWeek(cal.getTime()); return firstDate; } }