Here you can find the source of isWorkday(Date date)
public static boolean isWorkday(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isWorkday(Date date) { Calendar cal = Calendar.getInstance(); if (date != null) { cal.setTime(date);/* w w w . j a v a 2 s . co m*/ } int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); return !(dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY); } }