Java tutorial
//package com.java2s; import java.util.*; public class Main { public static long getDateDiff(Calendar cal1, Calendar cal2) { long cal1Day = cal1.getTimeInMillis() / 1000 / (60 * 60 * 24); long cal2Day = cal2.getTimeInMillis() / 1000 / (60 * 60 * 24); long diffDay = cal1Day - cal2Day; return diffDay; } }