Here you can find the source of toLocalDate(Date date)
public static LocalDate toLocalDate(Date date)
//package com.java2s; //License from project: Apache License import java.time.*; import java.util.*; public class Main { public static LocalDate toLocalDate(Date date) { if (date instanceof java.sql.Date) return ((java.sql.Date) date).toLocalDate(); else//from ww w . ja va 2s . c om return date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null; } }