Java examples for java.time:ZonedDateTime
java.util.Date To ZonedDateTime
//package com.java2s; import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.Date; public class Main { public static ZonedDateTime dateToLocalDateTime(Date date) { Instant endDateInstant = Instant.ofEpochMilli(date.getTime()); return ZonedDateTime.ofInstant(endDateInstant, ZoneOffset.UTC); }/*from ww w .j a v a2 s . co m*/ }