Here you can find the source of getDateDiff(Calendar c1, Calendar c2)
public static int getDateDiff(Calendar c1, Calendar c2)
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static int getDateDiff(Calendar c1, Calendar c2) { return (int) ((c2.getTimeInMillis() - c1.getTimeInMillis()) / (1000 * 60 * 60 * 24)); }/*from w w w . j av a2 s . co m*/ }