Java Hour Format formatFullDate(Object date)

Here you can find the source of formatFullDate(Object date)

Description

format Full Date

License

Apache License

Declaration

public static String formatFullDate(Object date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String formatFullDate(Object date) {
        return formatDate(date, "yyyy-MM-dd HH:mm:ss");
    }/*w w  w .j a  va2 s  .  c  om*/

    public static String formatDate(Object date, String fmt) {
        if (date == null) {
            return null;
        }
        if (!(date instanceof Date)) {
            return date.toString();
        }
        SimpleDateFormat sdf = new SimpleDateFormat(fmt);
        return sdf.format(date);
    }
}

Related

  1. formatForCookieExpiry(Date date)
  2. formatForFileName()
  3. formatForHttpHeader(long unixTime)
  4. formatFromDate(Date date)
  5. formatFromString(String date)
  6. formatFullTime(Date date)
  7. formatHDate(java.util.Date date)
  8. formatHoraFormatadaHHMMSSStr(Date hora)
  9. formatHour(final Date date)