Here you can find the source of diffDate(Date date, Date date1)
public static long diffDate(Date date, Date date1)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static long diffDate(Date date, Date date1) { return (getMillis(date) - getMillis(date1)) / 86400000L; }//from w ww . jav a 2 s . co m public static long getMillis(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getTimeInMillis(); } }