Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static int getWeek(int year, int month, int day) { Date date = new Date(year - 1900, month - 1, day); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); return dayOfWeek; } }