Here you can find the source of isDifferentDay(final Timestamp ts1, final Timestamp ts2)
public static boolean isDifferentDay(final Timestamp ts1, final Timestamp ts2)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static boolean isDifferentDay(final Timestamp ts1, final Timestamp ts2) { final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(ts1.getTime()); final int day1 = cal.get(Calendar.DAY_OF_MONTH), month1 = cal.get(Calendar.MONTH), year1 = cal.get(Calendar.YEAR); cal.setTimeInMillis(ts2.getTime()); final int day2 = cal.get(Calendar.DAY_OF_MONTH), month2 = cal.get(Calendar.MONTH), year2 = cal.get(Calendar.YEAR); return (day1 != day2 || month1 != month2 || year1 != year2); }/*from w w w . ja v a2 s.co m*/ }