Here you can find the source of CompareDay(Date orgin, Date target)
public static boolean CompareDay(Date orgin, Date target)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static final int OneDay = 1; public static boolean CompareDay(Date orgin, Date target) { long interval = target.getTime() - orgin.getTime(); return (int) (interval / (24 * 60 * 60 * 1000)) < OneDay; }// w w w .j ava 2s. co m }