Here you can find the source of currentTimestamp()
public static Timestamp currentTimestamp()
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); public static Timestamp currentTimestamp() { return new Timestamp(new Date().getTime()); }// ww w. ja v a 2 s . com public static String getTime(String pattern) { return new SimpleDateFormat(pattern).format(new Date()); } }