converting date to localdate in java code example
Example 1: date to localdate
dateToConvert.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
Example 2: local date to date java
public LocalDate convertToLocalDateViaInstant(Date dateToConvert) {
return dateToConvert.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
}