Java examples for java.time:LocalDateTime
java.util.Date as LocalDateTime
//package com.java2s; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; public class Main { public static LocalDateTime asLocalDateTime(Date date) { return Instant.ofEpochMilli(date.getTime()) .atZone(ZoneId.systemDefault()).toLocalDateTime(); }//from w ww . ja v a 2 s. c om }