Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static boolean isSameDate(long d1, long d2) { Calendar cal1 = Calendar.getInstance(); cal1.setTimeInMillis(d1); Calendar cal2 = Calendar.getInstance(); cal2.setTimeInMillis(d2); return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); } }