Here you can find the source of fmtTime(Date time)
public static String fmtTime(Date time)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String fmtTime(Date time) { return fmtTime(time, "yyyy-MM-dd HH:mm:ss"); }/*from w w w.j a v a2 s . c o m*/ public static String fmtTime(Date time, String pattern) { try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(time); } catch (Exception localException) { } return ""; } }