Here you can find the source of getFormatDateTime(java.util.Date date)
Parameter | Description |
---|---|
date | a parameter |
public static String getFormatDateTime(java.util.Date date)
//package com.java2s; //License from project: Open Source License public class Main { public static String getFormatDateTime(java.util.Date date) { return format(date, "yyyyMMddHHmmss"); }/*from ww w . j av a 2 s. c o m*/ public static String format(java.util.Date date, String format) { String result = ""; try { if (date != null) { java.text.DateFormat df = new java.text.SimpleDateFormat(format); result = df.format(date); } } catch (Exception e) { } return result; } }