Here you can find the source of formatDate(Timestamp timestamp)
public static String formatDate(Timestamp timestamp)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static final String DATE_PATTERN = "yyyy-MM-dd"; public static String formatDate(Timestamp timestamp) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN); return sdf.format(timestamp); }//from ww w . ja v a 2 s . c om }