Here you can find the source of getWeekDayNUM()
public static int getWeekDayNUM()
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public final static Calendar car = Calendar.getInstance(); public static int getWeekDayNUM() { car.setTimeInMillis(System.currentTimeMillis()); return (car.get(Calendar.DAY_OF_WEEK) - 1) == 0 ? 7 : (car.get(Calendar.DAY_OF_WEEK) - 1); }/* w ww. java2 s .c o m*/ }