Android Date Format format(Date date)

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

Description

Converts a java.util.Date object to a string using the defined default format yyyy-MM-dd HH:mm

Parameter

Parameter Description
date the date object to be formatted.

Return

the formatted date string.

Declaration

public static String format(Date date) 

Method Source Code

import android.util.Log;
import com.archee.picturedownloader.PictureDownloader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main{
    public static final SimpleDateFormat DEFAULT_FORMATTER = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm");
    /**/*  ww w .ja v  a  2s .  c o m*/
     * Converts a java.util.Date object to a string using the defined default format yyyy-MM-dd HH:mm
     * @param date the date object to be formatted.
     * @return the formatted date string.
     */
    public static String format(Date date) {
        return DEFAULT_FORMATTER.format(date);
    }
}

Related

  1. toString(Date date, String format)
  2. toString(Date value, String format)
  3. toStringFR(Date date)
  4. toStringUS(Date date)
  5. toTimeString(Date value)
  6. format(Date date, String pattern)
  7. formatData(Date date)
  8. formatDate(final Date date)
  9. getStringFromDate(Date date, String format)