Here you can find the source of getCurFullTimestampStr()
public static final String getCurFullTimestampStr()
//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 final String getCurFullTimestampStr() { return formatTimestamp(getCurFullTimestamp()); }/* w ww. ja va2s . co m*/ /** * @param aDate * @return formated time by yyyy-MM-dd HH:mm:ss */ public static final <T extends Date> String formatTimestamp(T date) { if (date == null) return null; SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return timestampFormat.format(date); } public static final String formatTimestamp(Long mills) { return formatTimestamp(new Date(mills)); } public static final Timestamp getCurFullTimestamp() { return new Timestamp(System.currentTimeMillis()); } /** * @param date * @param pattern: Date format pattern * @return */ public static final <T extends Date> String format(T date, String pattern) { if (date == null) return null; try { SimpleDateFormat df = new SimpleDateFormat(pattern); String result = df.format(date); return result; } catch (Exception e) { return null; } } }