Here you can find the source of formatDataTime(Timestamp intime)
public static String formatDataTime(Timestamp intime)
//package com.java2s; /*/*w ww . j a v a 2 s . c o m*/ * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit. * http://www.apache.org/licenses/LICENSE-2.0 */ import java.sql.Timestamp; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { public static String formatDataTime(Timestamp intime) { final String DATE_FORMATE = "yyyy-MM-dd HH:mm:ss"; DateFormat df = new SimpleDateFormat(DATE_FORMATE); return df.format(intime); } }