Here you can find the source of convertToDate(LocalDateTime dateTime)
public static Date convertToDate(LocalDateTime dateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Date; public class Main { public static Date convertToDate(LocalDateTime dateTime) { ZonedDateTime zdt = dateTime.atZone(ZoneId.systemDefault()); return Date.from(zdt.toInstant()); }/*from w w w .j a v a 2s. c o m*/ }