Here you can find the source of getDayOfWeek()
public static int getDayOfWeek()
//package com.java2s; /*//w ww. j a va 2s . co m * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Calendar; import java.util.Locale; public class Main { /** * @return int (day of week 1 = SUNDAY , ... 7 = SATURDAY) * @example int day = DateUtils.getDayOfWeek() */ public static int getDayOfWeek() { Calendar date = Calendar.getInstance(Locale.US); return date.get(Calendar.DAY_OF_WEEK); } /** * @return int (day of week 1 = SUNDAY , ... 7 = SATURDAY) * @example int day = DateUtils.getDayOfWeek(String date) * @parameter yyyymmddhhmmss ex. "20070101120500" , "20530101120500" */ public static int getDayOfWeek(Calendar date) { return date.get(Calendar.DAY_OF_WEEK); } }