Here you can find the source of isWorkDay(Date date)
public static final boolean isWorkDay(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static final boolean isWorkDay(Date date) { if (date == null) { throw new IllegalArgumentException("date is null."); }/* w w w .j a v a 2 s.c om*/ boolean ret = true; Calendar cal = Calendar.getInstance(); cal.setTime(date); int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) { ret = false; } return ret; } public static int get(Date date, int type) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(type); } }