Java examples for java.time:ZonedDateTime
to ZonedDateTime
//package com.java2s; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Date; public class Main { public static ZonedDateTime toZonedDateTime(Date utilDate) { if (utilDate == null) { return null; }/*from ww w. ja v a 2 s . c o m*/ final ZoneId systemDefault = ZoneId.systemDefault(); return ZonedDateTime.ofInstant(utilDate.toInstant(), systemDefault); } }