Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static boolean isSameDay(long lhs, long rhs) { Calendar lhsCal = Calendar.getInstance(); Calendar rhsCal = Calendar.getInstance(); lhsCal.setTimeInMillis(lhs); rhsCal.setTimeInMillis(rhs); return (lhsCal.get(Calendar.YEAR) == rhsCal.get(Calendar.YEAR)) && (lhsCal.get(Calendar.DAY_OF_YEAR) == rhsCal.get(Calendar.DAY_OF_YEAR)); } }