Java 8 introduced a new mechanism for working with dates implemented API from the java.time.* . In this case, you can use the following behavior pattern to compare dates:
Timestamp timestamp = new Timestamp(1502010000); LocalDateTime before = timestamp.toLocalDateTime(); LocalDateTime now = LocalDateTime.now(); int compareREsult = now.compareTo(before);
If compareResult negative number - if the compared date is later, positive - if earlier and zero if equal.
UPD:
Since there is an unrecorded condition in the question that the date should be compared without time, the following option is proposed:
Timestamp timestamp = new Timestamp(1502041448453l); // System.out.println(timestamp); выведет "2017-08-06 20:44:08.453" LocalDate localDateTime = timestamp.toLocalDateTime().toLocalDate(); LocalDate now = LocalDate.now(); // System.out.println(now); выведет "2017-08-06" // Выведет 0; System.out.println(now.compareTo(localDateTime));