Here you can find the source of asInstant(Date date)
public static Instant asInstant(Date date)
//package com.java2s; //License from project: Apache License import java.time.*; import java.util.Date; public class Main { /**/*from w ww.j av a 2 s .co m*/ * Creates an {@link Instant} from {@code java.util.Date} or it's subclasses. Null-safe. */ public static Instant asInstant(Date date) { if (date == null) return null; else return Instant.ofEpochMilli(date.getTime()); } }