Here you can find the source of dateFormatTime(final Date date)
Parameter | Description |
---|---|
date | the Date to format |
public static String dateFormatTime(final Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String TIME_FORMAT = "hh:mm a"; /**//from w w w. j a va 2s .c o m * Formats a {@linkplain Date} to the application wide format for time * * @param date * the {@linkplain Date} to format * @return the formated {@linkplain Date} */ public static String dateFormatTime(final Date date) { SimpleDateFormat sdf = new SimpleDateFormat(TIME_FORMAT); return sdf.format(date); } }