Here you can find the source of timestampFormat(Date date)
public static String timestampFormat(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String timestampFormat(long timestamp) { return timestampFormat(new Date(timestamp)); }/*from w ww .j ava2s. c om*/ public static String timestampFormat(Date date) { return getTimetampFormat().format(date); } public static DateFormat getTimetampFormat() { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } }