Here you can find the source of isBetween(Calendar time, Calendar start, Calendar end)
public static boolean isBetween(Calendar time, Calendar start, Calendar end)
//package com.java2s; /******************************************************************************* * Copyright (c) 2004, 2009 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w.j a v a 2 s.c om*/ * Tasktop Technologies - initial API and implementation *******************************************************************************/ import java.util.Calendar; public class Main { public static boolean isBetween(Calendar time, Calendar start, Calendar end) { return (time.compareTo(start) >= 0 && time.compareTo(end) <= 0); } }