Here you can find the source of getTime(Date dt, String format)
public static String getTime(Date dt, String format)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTime(Date dt, String format) { SimpleDateFormat st = new SimpleDateFormat(format); return st.format(dt); }/* ww w . ja v a 2s .co m*/ }