Here you can find the source of countDiffDay(Calendar c1, Calendar c2)
public static int countDiffDay(Calendar c1, Calendar c2)
//package com.java2s; import java.util.Calendar; public class Main { public static int countDiffDay(Calendar c1, Calendar c2) { int returnInt = 0; while (!c1.after(c2)) { c1.add(Calendar.DAY_OF_MONTH, 1); returnInt++;/*from www . j a va 2s. c o m*/ } if (returnInt > 0) { returnInt = returnInt - 1; } return (returnInt); } }