Here you can find the source of toLocalDate(final Date date)
public static LocalDate toLocalDate(final Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.Date; public class Main { public static LocalDate toLocalDate(final Date date) { if (date == null) { return null; } else {//from w ww . ja v a 2 s . c om String str = new SimpleDateFormat("yyyy-MM-dd").format(date); return LocalDate.parse(str); } } }