Here you can find the source of getWeekOfDate(Date dt)
public static String getWeekOfDate(Date dt)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static String getWeekOfDate(Date dt) { String[] weekDays = { "7", "1", "2", "3", "4", "5", "6" }; Calendar cal = Calendar.getInstance(); cal.setTime(dt);/*from w w w. j ava 2 s. c o m*/ int w = cal.get(Calendar.DAY_OF_WEEK) - 1; if (w < 0) w = 0; return weekDays[w]; } }