Java Calendar Between isBetween(Calendar time, Calendar start, Calendar end)

Here you can find the source of isBetween(Calendar time, Calendar start, Calendar end)

Description

is Between

License

Open Source License

Declaration

public static boolean isBetween(Calendar time, Calendar start, Calendar end) 

Method Source Code

//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);
    }
}

Related

  1. getDaysBetween(Calendar startDate, Calendar endDate)
  2. getDaysBetween(final Calendar start, final Calendar end)
  3. getFmtCalendar(Calendar c, long betweenTimeout, StringBuilder sb)
  4. hoursBetween(Calendar start, Calendar end, boolean assumeSameDate)
  5. hoursBetween(Calendar startDate, Calendar endDate)
  6. numberOfDaysBetween(Calendar start, Calendar end)