Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isTheSameDay(Date one, Date another) { Calendar _one = Calendar.getInstance(); _one.setTime(one); Calendar _another = Calendar.getInstance(); _another.setTime(another); int oneDay = _one.get(Calendar.DAY_OF_YEAR); int anotherDay = _another.get(Calendar.DAY_OF_YEAR); return oneDay == anotherDay; } }