Here you can find the source of getWeekID(Date dateValue)
public static String getWeekID(Date dateValue)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static String getWeekID(Date dateValue) { String strWeekID = ""; Calendar objCalendar = Calendar.getInstance(); objCalendar.setTime(dateValue);//w w w . ja v a 2 s . co m int iYear = objCalendar.get(Calendar.YEAR); int iWeek = objCalendar.get(Calendar.WEEK_OF_YEAR); if (iWeek >= 10) { strWeekID = iYear + String.valueOf(iWeek); } else { strWeekID = iYear + "0" + iWeek; } return strWeekID; } }