Here you can find the source of formatTimestamp(Date date)
public static String formatTimestamp(Date date)
//package com.java2s; //License from project: LGPL import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from ww w . j ava2 s . c o m * Formats a date object based on the format setting * in compass.timestampFormat * @params date date object to format */ public static String formatTimestamp(Date date) { if (date == null) { return ""; } return getTimestampFormat().format(date); } private static SimpleDateFormat getTimestampFormat() { String defaultTimestampFormat = "MM/dd/yyyy HH:mm:ss"; return new SimpleDateFormat(defaultTimestampFormat); } }