Here you can find the source of asLocalDate(Date date)
public static LocalDate asLocalDate(Date date)
//package com.java2s; //License from project: Open Source License import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; import java.util.Date; public class Main { public static LocalDate asLocalDate(Date date) { if (date == null) { return null; }/*from w w w.jav a2 s .c o m*/ if (date instanceof java.sql.Date) { return ((java.sql.Date) date).toLocalDate(); } else { return Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDate(); } } }