Here you can find the source of getThisweekFirst(Date early)
public static final Date getThisweekFirst(Date early)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static final Date getThisweekFirst(Date early) { Calendar c1 = Calendar.getInstance(); c1.setTime(early);/*from w ww .java2s . c o m*/ int week = c1.get(Calendar.DAY_OF_WEEK); int firstw = -1 * (week - 1); Date weekFirst = dayAdd(early, firstw); return weekFirst; } public static Date dayAdd(Date date, int days) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); cal.setTime(date); cal.add(Calendar.DATE, days); return cal.getTime(); } }