Here you can find the source of getCurrentDayOfWeek()
public static final int getCurrentDayOfWeek()
//package com.java2s; import java.util.Calendar; public class Main { public static final int getCurrentDayOfWeek() { int day = Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1; return day == 0 ? (day + 7) : day; }/* w ww.ja va 2 s . c om*/ }