Here you can find the source of Format(DateFormat format, Timestamp time)
public static String Format(DateFormat format, Timestamp time)
//package com.java2s; import java.sql.Timestamp; import java.text.DateFormat; import java.util.Date; public class Main { public static String Format(DateFormat format, Timestamp time) { synchronized (format) { String t = ""; try { t = format.format(time); } catch (Exception e) { return t; }/* www . ja v a2s. c o m*/ return t; } } public static String Format(DateFormat format, Date time) { synchronized (format) { String t = ""; try { t = format.format(time).replace("24:", "00:"); } catch (Exception e) { return t; } return t; } } public static String Format(DateFormat format, long time) { synchronized (format) { String t = ""; try { t = format.format(time); } catch (Exception e) { return t; } return t; } } }