Here you can find the source of toInstant(Date date)
public static Instant toInstant(Date date)
//package com.java2s; //License from project: Open Source License import java.sql.Date; import java.time.Instant; import java.time.ZoneOffset; public class Main { public static Instant toInstant(Date date) { return date.toLocalDate().atStartOfDay(ZoneOffset.UTC).toInstant(); }// w w w . j a v a2s .c o m }