Here you can find the source of getDateByWeek(int week)
public static Date getDateByWeek(int week)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getDateByWeek(int week) { Calendar cal = Calendar.getInstance(); int nowWeek = cal.get(Calendar.DAY_OF_WEEK); if (nowWeek == Calendar.SUNDAY) { nowWeek = 6;// w ww . j a v a 2s.c o m } else { nowWeek -= 2; } return getDateByDaysLate(week - nowWeek, cal.getTime()); } public static Date getDateByDaysLate(int day, Date date) { Calendar todayStart = Calendar.getInstance(); if (date != null) { todayStart.setTime(date); } todayStart.set(Calendar.HOUR_OF_DAY, 0); todayStart.set(Calendar.MINUTE, 0); todayStart.set(Calendar.SECOND, 0); todayStart.set(Calendar.MILLISECOND, 0); todayStart.add(Calendar.DATE, day); return todayStart.getTime(); } }