Here you can find the source of getFirstOfWeek(Calendar cal, int week)
public static Timestamp getFirstOfWeek(Calendar cal, int week)
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp getFirstOfWeek(Calendar cal, int week) { if (cal == null) { cal = Calendar.getInstance(); }//from w w w .j a va 2 s.co m cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return new Timestamp(cal.getTimeInMillis()); } }