Java Time Format getFormatDateTime(java.util.Date date)

Here you can find the source of getFormatDateTime(java.util.Date date)

Description

get Format Date Time

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static String getFormatDateTime(java.util.Date date) 

Method Source Code

//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;
    }
}

Related

  1. getFormatDate(Date date, boolean ShowTimePart_in)
  2. getFormatDate(String timeString, String format)
  3. getFormatDatetime()
  4. getFormatDateTime(Date date)
  5. getFormatDateTime(Date date, String format)
  6. getFormattedCurrentDateAndTime()
  7. getFormattedCurrentDateTime(String pattern)
  8. getFormattedDateAndTime(final Date date)
  9. getFormattedDateTime(Date date, String pattern)