Here you can find the source of getTimeAsString(Date date)
public static String getTimeAsString(Date date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final DateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss"); public static String getTimeAsString(Date date) { String value = null;/*from ww w . ja v a2 s . c o m*/ if (date != null) { value = TIME_FORMAT.format(date); } return value; } }