Here you can find the source of getTimeFormat(java.util.Date date)
public static String getTimeFormat(java.util.Date date)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { /** The time format string:(HH:mm:ss) */ public static final String TIME_FORMAT_STR = "HH:mm:ss"; public static String getTimeFormat(java.util.Date date) { return getFormat(date, TIME_FORMAT_STR); }/* w ww . jav a2 s . com*/ public static String getFormat(java.util.Date date, String parseFormat) { if (null == date) { return null; } if (null == parseFormat || "".equalsIgnoreCase(parseFormat)) { return date.toString(); } return new SimpleDateFormat(parseFormat).format(date); } }