util date to localdate java 8 code example
Example 1: localdate to date java
// Localdate to Date
Date.from(localdate.atStartOfDay(ZoneId.systemDefault()).toInstant())
Example 2: how to turna date into a LocalDateTime java
public LocalDateTime convertToLocalDateTimeViaMilisecond(Date dateToConvert) {
return Instant.ofEpochMilli(dateToConvert.getTime())
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
}