Here you can find the source of dayDiff(Date date1, Date date2)
public static int dayDiff(Date date1, Date date2)
//package com.java2s; //License from project: Open Source License import java.util.Date; public class Main { public static final long DAY = 24 * 60 * 60 * 1000L; public static int dayDiff(Date date1, Date date2) { long diff = date1.getTime() - date2.getTime(); return (int) (diff / DAY); }// w ww .j a v a2 s .c om }