Here you can find the source of getTimeStamp()
public static Timestamp getTimeStamp()
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static Timestamp getTimeStamp() { String d = new SimpleDateFormat(TIME_FORMAT).format(Calendar.getInstance().getTime()); return Timestamp.valueOf(d); }// w w w .ja va 2s. c om }