Java tutorial
import java.time.LocalDate; public class Main { public static void main(String[] argv) { LocalDate date1 = LocalDate.now(); LocalDate date2 = LocalDate.of(date1.getYear(), date1.getMonth(), date1.getDayOfMonth()); if (date1.equals(date2)) { System.out.printf("Today %s and date1 %s are same date %n", date1, date2); } } }