how to use localdate in java code example
Example 1: localdate to date java
Date.from(localdate.atStartOfDay(ZoneId.systemDefault()).toInstant())
Example 2: localdatetime java example
LocalDateTime current=LocalDateTime.now();
LocalDateTime dateTime=LocalDateTime.of(year,month,day,hour,minute,second);
dateTime.getHour();
dateTime.getDayOfWeek();
dateTime.isBefore(someOtherDateTime);
dateTime.toLocalDate();
dateTime.toLocalTime();
Example 3: string to localdate in java
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/MM/yyyy");
String date = "16/08/2016";
LocalDate localDate = LocalDate.parse(date, formatter);