Here you can find the source of isInWorkTime(Calendar start)
public static boolean isInWorkTime(Calendar start)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**/* ww w. ja va 2 s. co m*/ * The default when the workday ends (5PM) */ public static final int END_WORKDAY = 17; /** * The default when the workday starts (7AM) */ public static final int START_WORKDAY = 7; /** * Determines whether or not the time of the date is within the work day * * @see #START_WORKDAY * @see #END_WORKDAY * @see #isBeforeWorkTime(Calendar) * @see #isAfterWorkTime(Calendar) */ public static boolean isInWorkTime(Calendar start) { return !isBeforeWorkTime(start) && !isAfterWorkTime(start); } /** * Determines whether or not the date is before the start of the work day * * @see #START_WORKDAY */ public static boolean isBeforeWorkTime(Calendar start) { final int hourOfDay = start.get(Calendar.HOUR_OF_DAY); return hourOfDay < START_WORKDAY; } /** * Determines whether or not the date is after the start of the work day * * @see #END_WORKDAY */ public static boolean isAfterWorkTime(Calendar start) { final int hourOfDay = start.get(Calendar.HOUR_OF_DAY); return hourOfDay >= END_WORKDAY; } }