Here you can find the source of calculateRangeInDays(Calendar start, Calendar end)
private static long calculateRangeInDays(Calendar start, Calendar end)
//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); } }