Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isSameDay(long day1, long day2) { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String str1 = sdf.format(new Date(day1)); String str2 = sdf.format(new Date(day2)); if (str1.equals(str2)) { return true; } return false; } }