Here you can find the source of getWeekOfYear(String date)
public static String getWeekOfYear(String date)
//package com.java2s; import java.util.Calendar; public class Main { public static String getWeekOfYear(String date) { String[] tempYear = date.trim().split("-"); Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, Integer.valueOf(tempYear[0])); cal.set(Calendar.MONTH, (Integer.valueOf(tempYear[1]) - 1)); cal.set(Calendar.DATE, Integer.valueOf(tempYear[2])); int week = cal.get(Calendar.WEEK_OF_YEAR); return String.valueOf(week); }//from w w w. j av a 2s .c om }