Here you can find the source of ToTimeStr(Date dt)
public static String ToTimeStr(Date dt)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String ToTimeStr(Date dt) { if (dt == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return sdf.format(dt); }/*from w w w. j a v a2 s. c om*/ }