Java 8 – Convert java.util.Date to java.time.LocalDate

by | Nov 20, 2018

Straightforward conversion of java.util.Date to java.time.LocalDate
   Java


java.util.Date d = new java.util.Date();

java.time.LocalDate localDate = 
         d.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();

* Seriously, does this have to be this tedious? Java is becoming more and more like filling out tax forms.