Here you can find the source of dateToHHmmStr(Date date)
public static String dateToHHmmStr(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String NORMAL_PATTERN = "yyyy-MM-dd HH:mm:ss"; private static final String HH_MM_PATTERN = "HH:mm"; public static String dateToHHmmStr(Date date) { return dateToString(date, HH_MM_PATTERN); }//from w ww . j av a 2 s . c o m public static String dateToString(Date date, String pattern) { if (date == null) { date = new Date(); } SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(date); } @Deprecated public static String dateToString(Date date) { return dateToStr(date); } public static String dateToStr(Date date) { if (date == null) { return ""; } return dateToString(date, NORMAL_PATTERN); } public static String dateToStr() { return dateToStr(new Date()); } }