Here you can find the source of getCurrentTimeStamp(String format)
public static String getCurrentTimeStamp(String format)
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Timestamp getCurrentTimestamp() { return new Timestamp(System.currentTimeMillis()); }/*w w w . j a v a2 s. c o m*/ public static String getCurrentTimeStamp(String format) { SimpleDateFormat f = new SimpleDateFormat(format); String timeStamp = f.format(new Date()); return timeStamp; } }