Here you can find the source of getWeekDay(Date date)
private static String getWeekDay(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { private static final String[] WEEK_DAYS = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; private static String getWeekDay(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date);/*from w w w . j av a2 s .c o m*/ int idx = cal.get(Calendar.DAY_OF_WEEK) - 1; return WEEK_DAYS[idx]; } }