Here you can find the source of getCurrentWeek(Calendar cal)
public static int getCurrentWeek(Calendar cal)
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static int getCurrentWeek() { Calendar cal = Calendar.getInstance(); return cal.get(Calendar.WEEK_OF_YEAR); }// w w w . j a va2s . c o m public static int getCurrentWeek(Calendar cal) { if (cal == null) { cal = Calendar.getInstance(); } return cal.get(Calendar.WEEK_OF_YEAR); } public static int getCurrentWeek(Timestamp t1) { Calendar cal; if (t1 == null) { cal = Calendar.getInstance(); } else { cal = new GregorianCalendar(); cal.setTime(t1); } return cal.get(Calendar.WEEK_OF_YEAR); } }