Here you can find the source of toLocalDateTime(Date utilDate)
public static LocalDateTime toLocalDateTime(Date utilDate)
//package com.java2s; //License from project: Apache License import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Date; public class Main { public static LocalDateTime toLocalDateTime(Date utilDate) { if (utilDate == null) { return null; }//from w w w . j a v a 2s.c o m ZonedDateTime zonedDateTime = toZonedDateTime(utilDate); return zonedDateTime.toLocalDateTime(); } public static ZonedDateTime toZonedDateTime(Date utilDate) { if (utilDate == null) { return null; } final ZoneId systemDefault = ZoneId.systemDefault(); return ZonedDateTime.ofInstant(utilDate.toInstant(), systemDefault); } }