Java Hour Format format(Date date)

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

Description

format

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static String format(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from www.  j  a v a2s.c  om
     *
     * @param date
     * @return
     */
    public static String format(Date date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(date);
        return dateString;
    }
}

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, String dateFormat)
  7. format(Date date, String format)
  8. format(Date date, String format)
  9. format(Date date, String pattern)