Here you can find the source of weekStart()
public static GregorianCalendar weekStart()
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /** First day of work within a week */ public static final int FIRST_DAY_OF_WORK = Calendar.MONDAY; /**/*w w w.j a v a 2s . c o m*/ @return the starting moment of the current week */ public static GregorianCalendar weekStart() { return weekStart(new GregorianCalendar()); } /** @return the starting moment of the week containing the given date Note that it is set to the FIRST_DAY_OF_WORK. */ public static GregorianCalendar weekStart(GregorianCalendar cal) { GregorianCalendar newCal = (GregorianCalendar) cal.clone(); newCal.set(Calendar.DAY_OF_WEEK, FIRST_DAY_OF_WORK); newCal.set(Calendar.HOUR_OF_DAY, 0); newCal.set(Calendar.MINUTE, 0); newCal.set(Calendar.SECOND, 0); newCal.set(Calendar.MILLISECOND, 0); return newCal; } }