Here you can find the source of dateFormat(java.util.Date date, String formatStr)
public static String dateFormat(java.util.Date date, String formatStr)
//package com.java2s; /*/*w ww. j a v a 2s . co m*/ * BJAF - Beetle J2EE Application Framework * ???J2EE??????????? * ??????2003-2015 ??? (www.beetlesoft.net) * * ?????????????????? *<http://www.apache.org/licenses/LICENSE-2.0> *???????????????????????? * * ??????????????????????????????? * ??? <yuhaodong@gmail.com/>. */ public class Main { public static String dateFormat(java.util.Date date, String formatStr) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(formatStr); return sdf.format(date); } }