Here you can find the source of transfer(java.util.Date date)
public static LocalDateTime transfer(java.util.Date date)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.time.LocalDateTime; import java.time.ZoneId; public class Main { private static final ZoneId defaultZoneId = ZoneId.systemDefault(); public static LocalDateTime transfer(Timestamp timestamp) { return timestamp == null ? null : LocalDateTime.ofInstant(timestamp.toInstant(), defaultZoneId); }//from w w w . j a va 2s .c o m public static LocalDateTime transfer(java.util.Date date) { return date == null ? null : LocalDateTime.ofInstant(date.toInstant(), defaultZoneId); } }