Java Date Format formatDate(final Date date)

Here you can find the source of formatDate(final Date date)

Description

formats a date object to a nice format

License

Open Source License

Parameter

Parameter Description
date the date to format

Return

a nicely formatted date

Declaration


public static String formatDate(final Date date) 

Method Source Code

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

import java.util.Date;

import java.text.SimpleDateFormat;

public class Main {
    /**// w  w  w .j  ava 2  s.  c o m
     *  formats a date object to a nice format
     * 
     *  @param date the date to format
     *  @return a nicely formatted date
     * 
     */

    public static String formatDate(final Date date) {

        final SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd, yyyy");

        return formatter.format(date);

    }
}

Related

  1. formatDate(Date value)
  2. formatDate(DateFormat format, Date date)
  3. formatDate(final Calendar cal)
  4. formatDate(final Calendar date)
  5. formatDate(final Date dat)
  6. formatDate(final Date date)
  7. formatDate(final Date date)
  8. formatDate(final Date date)
  9. formatDate(final Date date)