Here you can find the source of diffDay(Date startDate, Date endDate)
public static int diffDay(Date startDate, Date endDate)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//from w w w . j av a2s. c o m * Returns the number of days difference between two dates * DUPLICATE METHOD? * * @return Number of days difference */ public static int diffDay(Date startDate, Date endDate) { if (startDate == null || endDate == null) { return 0; } return (int) ((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)); } }