Here you can find the source of getThisWeekStartTime()
public static Date getThisWeekStartTime()
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; public class Main { public static Date getThisWeekStartTime() { Calendar today = Calendar.getInstance(); today.set(Calendar.DAY_OF_WEEK, today.getFirstDayOfWeek()); Calendar weekFirstDay = Calendar.getInstance(); weekFirstDay.clear();// w w w . j a va 2 s. c o m weekFirstDay.set(Calendar.YEAR, today.get(Calendar.YEAR)); weekFirstDay.set(Calendar.MONTH, today.get(Calendar.MONTH)); weekFirstDay.set(Calendar.DATE, today.get(Calendar.DATE)); return weekFirstDay.getTime(); } public static Timestamp getTime() { return new Timestamp(new Date().getTime()); } }