Here you can find the source of daysBetweenCalendarDates(final Calendar firstDate, final Calendar secondDate)
public static long daysBetweenCalendarDates(final Calendar firstDate, final Calendar secondDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static long daysBetweenCalendarDates(final Calendar firstDate, final Calendar secondDate) { return ((secondDate.getTimeInMillis() - firstDate.getTimeInMillis()) / (1000 * 60 * 60 * 24)); }/* w w w .j av a 2 s . co m*/ }