Here you can find the source of toTimeString(Date dateTime)
public static String toTimeString(Date dateTime)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.util.Date; public class Main { public static String toTimeString(Date dateTime) { DateFormat dateFormat = DateFormat.getDateTimeInstance(); return dateTime != null ? dateFormat.format(dateTime) : ""; }/*from ww w .ja v a2 s . co m*/ }