Here you can find the source of getCurrentTimestamp()
public static String getCurrentTimestamp()
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static String getCurrentTimestamp() { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Timestamp(System.currentTimeMillis())); }/*w w w . ja v a 2 s . c o m*/ }