Java Hour Format formatHDate(java.util.Date date)

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

Description

format H Date

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String formatHDate(java.util.Date date) {
        return format(date, "yyyy-MM-dd HH:mm:ss");
    }//  w w  w. java2  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. formatForHttpHeader(long unixTime)
  2. formatFromDate(Date date)
  3. formatFromString(String date)
  4. formatFullDate(Object date)
  5. formatFullTime(Date date)
  6. formatHoraFormatadaHHMMSSStr(Date hora)
  7. formatHour(final Date date)
  8. formatHours(Locale locale, double totalhours)
  9. formatHours(long millis)