Here you can find the source of getWeekStartEndDate(int timeInfo, String yearInfo)
public static String[] getWeekStartEndDate(int timeInfo, String yearInfo)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String[] getWeekStartEndDate(int timeInfo, String yearInfo) { String[] startEndDate = new String[2]; Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.set(Calendar.WEEK_OF_YEAR, timeInfo); cal.set(Calendar.YEAR, Integer.parseInt(yearInfo)); SimpleDateFormat formatter = new SimpleDateFormat("dd/MMM/yyyy"); cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); startEndDate[0] = formatter.format(cal.getTime()); cal.add(Calendar.DAY_OF_WEEK, 6); startEndDate[1] = formatter.format(cal.getTime()); return startEndDate; }/*from w ww . j a v a2s . co m*/ }