What is the best way to convert a java.util.Date object to the new JDK 8/JSR-310 java.time.LocalDate?
java.util.Date
java.time.LocalDate
Date input = new Date(); Loca
first, it's easy to convert a Date to an Instant
Instant timestamp = new Date().toInstant();
Then, you can convert the Instant to any date api in jdk 8 using ofInstant() method:
LocalDateTime date = LocalDateTime.ofInstant(timestamp, ZoneId.systemDefault());