Here you can find the source of getTimestamp(Date date)
public static Timestamp getTimestamp(Date date)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.*; public class Main { public static Timestamp getTimestamp() { return new Timestamp(System.currentTimeMillis()); }//w w w . j a v a 2 s .c o m public static Timestamp getTimestamp(Date date) { return date == null ? null : new Timestamp(date.getTime()); } }