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.Date; public class Main { public static Timestamp getTimestamp(long millis) { return new Timestamp(millis); }/*www . j a va 2 s.c om*/ public static Timestamp getTimestamp(String time) { return new Timestamp(Long.parseLong(time)); } public static Timestamp getTimestamp() { return new Timestamp(new Date().getTime()); } public static Timestamp getTimestamp(Date date) { return new Timestamp(date.getTime()); } }