Here you can find the source of getDayOfWeek(Date date)
public static String getDayOfWeek(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static String getDayOfWeek(Date date) { String[] weekDays = { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" }; Calendar cal = Calendar.getInstance(); cal.setTime(date);//from w ww .j a va 2 s.c o m int w = cal.get(Calendar.DAY_OF_WEEK) - 1; if (w < 0) w = 0; return weekDays[w]; } }