Here you can find the source of getWeek(int year, int month, int day)
public static int getWeek(int year, int month, int day) throws Exception
//package com.java2s; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static int getWeek(int year, int month, int day) throws Exception { Calendar c = new GregorianCalendar(); c.set(year, month - 1, day);//from www. ja v a2 s . c o m return c.get(Calendar.DAY_OF_WEEK); } }