Here you can find the source of getTimeString(Timestamp timestamp)
public static String getTimeString(Timestamp timestamp)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { public static String getTimeString(Timestamp timestamp) { DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try {/*from ww w . jav a 2s . com*/ String str = sdf.format(timestamp); return str; } catch (Exception e) { e.printStackTrace(); } return null; } }