Java Hour Format format(Date date)

Here you can find the source of format(Date date)

Description

format

License

Open Source License

Declaration

public static String format(Date date) throws ParseException 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String format(Date date) throws ParseException {
        if (date == null) {
            return null;
        }/*from w w  w .j a v  a  2s  .c o m*/
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return sdf.format(date);
    }
}

Related

  1. format(Date date)
  2. format(Date date)
  3. format(Date date)
  4. format(Date date)
  5. format(Date date)
  6. format(Date date)
  7. format(Date date)
  8. format(Date date)
  9. format(Date date, String dateFormat)