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

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

Description

format Date Time

License

Apache License

Declaration

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

Method Source Code

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

import java.text.SimpleDateFormat;

public class Main {
    public static String formatDateTime(java.util.Date date) {
        return format(date, "yyyy-MM-dd HH:mm:ss");
    }/*from w w  w .j  a  va  2  s.  co m*/

    public static String format(java.util.Date date) {
        return date == null ? "" : format(date, "yyyy-MM-dd");
    }

    public static String format(java.util.Date date, String pattern) {
        return date == null ? "" : new SimpleDateFormat(pattern).format(date);
    }
}

Related

  1. formatDateTime(Date myDate)
  2. formatDateTime(final Calendar cal)
  3. formatDateTime(final Date dat)
  4. formatDateTime(final Date date)
  5. formatDateTime(java.util.Date d)
  6. formatDateTime(java.util.Date date)
  7. formatDateTime(java.util.Date paramDate)
  8. formatDateTime(String date)
  9. FormatDateTime(String dateString)