Here you can find the source of getShowTime(Date date, String format)
public static String getShowTime(Date date, String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getShowTime(Date date, String format) { SimpleDateFormat df = new SimpleDateFormat(format); if (date == null) { return ""; } else {// w w w.j a v a 2 s .c om return df.format(date); } } }