Here you can find the source of diffDate(java.util.Date date, java.util.Date date1)
public static int diffDate(java.util.Date date, java.util.Date date1)
//package com.java2s; public class Main { public static int diffDate(java.util.Date date, java.util.Date date1) { return (int) ((getMillis(date) - getMillis(date1)) / (24 * 3600 * 1000)); }//from ww w . j a v a 2 s. c o m public static long getMillis(java.util.Date date) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTime(date); return c.getTimeInMillis(); } }