Here you can find the source of dateDiff(Date beginDate, Date endDate)
public static long dateDiff(Date beginDate, Date endDate)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static long dateDiff(Date beginDate, Date endDate) { long beginDateseconds = beginDate.getTime(); long endDateseconds = endDate.getTime(); long diff = endDateseconds - beginDateseconds; long diffDays = diff / (24 * 60 * 60 * 1000); return diffDays; }//from w ww .j ava 2 s . co m }