Here you can find the source of getWeekOfYear(Date date)
public static int getWeekOfYear(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static int getWeekOfYear(Date date) { String weekOfYear = format(date, "ww"); return Integer.parseInt(weekOfYear); }/*from w w w . j av a 2 s . co m*/ public static String format(Date date, String formatPattern) { // Assert.notNull(date); return new SimpleDateFormat(formatPattern).format(date); } }