Here you can find the source of TimestampToDateStr(Timestamp tmp)
public static String TimestampToDateStr(Timestamp tmp)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static final SimpleDateFormat SHORT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static String TimestampToDateStr(Timestamp tmp) { return SHORT_DATE_FORMAT.format(tmp); }/*from w w w.j a v a 2 s .co m*/ }