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.LocalDate; import java.util.Calendar; import java.util.Date; public class Main { public static LocalDate toLocalDate(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);// w w w .j a v a 2 s . c om LocalDate localeData = LocalDate.of(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); return localeData; } }