Here you can find the source of getCurrentWeek(Timestamp t1)
public static int getCurrentWeek(Timestamp t1)
//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); }/*from w w w. java 2 s . co 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); } }