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.

Pin It on Pinterest

Share This