Java Calendar Calculate calculateRangeInDays(Calendar start, Calendar end)

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

Description

calculate Range In Days

License

Open Source License

Declaration

private static long calculateRangeInDays(Calendar start, Calendar end) 

Method Source Code


//package com.java2s;
/*//from   w  ww.j  a  va2s  .  c o  m
 * 
 * Copyright (c) 2011 by Jgility Development Group
 * 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:
 *     Karsten Schulz
 *
 */

import java.util.Calendar;

public class Main {
    private static long calculateRangeInDays(Calendar start, Calendar end) {
        long diff = end.getTimeInMillis() - start.getTimeInMillis();
        return diff / (1000 * 60 * 60 * 24);
    }
}

Related

  1. calcTimezone(Calendar cal)
  2. calculateDuration(Calendar para_c1, Calendar para_c2)
  3. calculateHourDiff(Calendar cal1, Calendar cal2)
  4. calculateMinimalDaysInFirstWeek(Calendar calendar)
  5. calculateMonthsInBetween(Calendar startPoint, Calendar endPoint)
  6. calculateWeeksInBetween(Calendar startPoint, Calendar endPoint)
  7. calDateOnly(Calendar iniCal)
  8. calendarIterator(final int iterateType, final Calendar startCal, final Calendar endCal)
  9. cloneCalendar(Calendar in)