Here you can find the source of toSqlTimestamp(java.util.Date date)
public static java.sql.Timestamp toSqlTimestamp(java.util.Date date)
//package com.java2s; //License from project: Apache License import java.time.Instant; public class Main { public static java.sql.Timestamp toSqlTimestamp(java.util.Date date) { if (date == null) { return null; }/*from ww w . j ava2s .c om*/ return toSqlTimestamp(date.getTime()); } public static java.sql.Timestamp toSqlTimestamp(long time) { return new java.sql.Timestamp(time); } public static java.sql.Timestamp toSqlTimestamp(Instant instant) { if (instant == null) { return null; } return toSqlTimestamp(instant.toEpochMilli()); } }