Here you can find the source of dayDiff(Date date1, Date date2)
public static long dayDiff(Date date1, Date date2)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static long dayDiff(Date date1, Date date2) { return (date2.getTime() - date1.getTime()) / 86400000; }/*from w w w . j a v a 2s. c o m*/ }