When I test this code:
java.util.Date date = new java.util.Date();
java.util.Date stamp = new java.sql.Timestamp(date.getTime());
assertTrue(date.equals(sta
I've resolved converting both Date and TimeStamp into a Calendar object and then i've compared the single Calendar's properties:
Calendar date = Calendar.getInstance();
date.setTimeInMillis(dateObject.getTime());
Calendar timestamp = Calendar.getInstance();
timestamp.setTimeInMillis(timestampObject.getTime());
if (effettoAppendice.get(Calendar.DAY_OF_MONTH) == timestamp.get(Calendar.DAY_OF_MONTH) &&
effettoAppendice.get(Calendar.MONTH) == timestamp.get(Calendar.MONTH) &&
effettoAppendice.get(Calendar.YEAR) == timestamp.get(Calendar.YEAR)) {
System.out.println("Date and Timestamp are the same");
} else {
System.out.println("Date and Timestamp are NOT the same");
}
Hope this helps.