Here you can find the source of getTimeStr(Date date)
Parameter | Description |
---|---|
date | the datetime |
public static String getTimeStr(Date date)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { final static DateFormat HOUR_DATE_FORMAT = new SimpleDateFormat("HH:mm"); /**/*from w w w.ja va 2 s.c o m*/ * Returns "22:00" for param "2014-02-09 22:00" * * @param date the datetime * @return time str */ public static String getTimeStr(Date date) { return HOUR_DATE_FORMAT.format(date); } }