Here you can find the source of timeFormatDate(Date d)
public static String timeFormatDate(Date d)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static String timeFormatDate(Date d) { return timeFormat.format(d); }//ww w . ja va 2 s. c o m }