Here you can find the source of toLocalDateTime(Date date)
public static LocalDateTime toLocalDateTime(Date date)
//package com.java2s; //License from project: Creative Commons License import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; public class Main { public static LocalDateTime toLocalDateTime(Date date) { if (date == null) { return null; }//from ww w.ja va 2s .co m Instant instant = Instant.ofEpochMilli(date.getTime()); return LocalDateTime.ofInstant(instant, getZoneId()); } private static ZoneId getZoneId() { return ZoneId.systemDefault(); } }