Here you can find the source of timeToString(java.util.Date date)
public static String timeToString(java.util.Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; public class Main { public static final String TIME_FORMAT = "HH:mm:ss"; public static String timeToString(java.util.Date date) { try {// w w w . ja v a2s . c o m return ((date == null) ? "" : getTimeFormatter().format(date)); } catch (Exception e) { return ""; } } public static SimpleDateFormat getTimeFormatter() { return new SimpleDateFormat(TIME_FORMAT); // m_timeFormatter; } }