Here you can find the source of weekCal(int weekNumber)
public static GregorianCalendar weekCal(int weekNumber)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static final int INITIAL_YEAR = 2000; /** First day of work within a week */ public static final int FIRST_DAY_OF_WORK = Calendar.MONDAY; /**//w w w. ja v a 2 s .c om @return the week start-date that is weekNumber offset from INITIAL_YEAR */ public static GregorianCalendar weekCal(int weekNumber) { int yearNum = INITIAL_YEAR + (weekNumber / 52); int weekNum = weekNumber % 52; GregorianCalendar cal = new GregorianCalendar(); cal.set(Calendar.YEAR, yearNum); cal.set(Calendar.WEEK_OF_YEAR, weekNum); return weekStart(cal); } /** @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; } }