Here you can find the source of getTimestamp()
public static Timestamp getTimestamp()
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; public class Main { public static Timestamp getTimestamp() { return toTimestamp(getSqlDate()); }/* ww w . ja v a2s.c o m*/ public static Timestamp toTimestamp(java.sql.Date date) { if (date == null) { return null; } return new Timestamp(date.getTime()); } public static java.sql.Date getSqlDate() { return new java.sql.Date(getDate().getTime()); } private static Date getDate() { return Calendar.getInstance().getTime(); } }