Here you can find the source of toCalendar(LocalDate localDate)
public static Calendar toCalendar(LocalDate localDate)
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Date; public class Main { public static final ZoneId DEFAULT_ZONEID = ZoneId.systemDefault(); public static Calendar toCalendar(LocalDate localDate) { if (localDate == null) { return null; }/*from w ww . j a va2 s.c o m*/ Date date = toDate(localDate); Calendar cal = Calendar.getInstance(); cal.setTime(date); ; return cal; } public static Calendar toCalendar(LocalDateTime dateTime) { if (dateTime == null) { return null; } Date date = toDate(dateTime); Calendar cal = Calendar.getInstance(); cal.setTime(date); ; return cal; } public static Date toDate(LocalDateTime dateTime) { if (dateTime == null) { return null; } ZonedDateTime zonedDateTime = dateTime.atZone(DEFAULT_ZONEID); return Date.from(zonedDateTime.toInstant()); } public static Date toDate(LocalDate localDate) { if (localDate == null) { return null; } ZonedDateTime zonedDateTime = localDate.atStartOfDay(DEFAULT_ZONEID); return Date.from(zonedDateTime.toInstant()); } public static Date toDate(ZonedDateTime dateTime) { if (dateTime == null) { return null; } return Date.from(dateTime.toInstant()); } }