Android Date to String Convert getLongDateStr(Date date)

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

Description

Converts given date time to long date string.

Parameter

Parameter Description
date to be converted

Return

str

Declaration

public static String getLongDateStr(Date date) 

Method Source Code

//package com.java2s;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    final static DateFormat LONG_DATE_FORMAT = new SimpleDateFormat(
            "EEE, MMM dd");

    /**/*from w ww.j a va 2  s .c om*/
     * Converts given date time to long date string.
     * <p/>
     * Example input: "2014-09-10 22:15:12"
     * Example output: "Wed, Sep 10"
     *
     * @param date to be converted
     * @return str
     */
    public static String getLongDateStr(Date date) {
        return LONG_DATE_FORMAT.format(date);
    }
}

Related

  1. getDateTimeString(Date date)
  2. getDateTimeString(Date date, int format, Locale currentLocale)
  3. getFileName()
  4. getFormatString(Date date, String dateFormat)
  5. getHourInFloat(Date date)
  6. getLongFormat(Date date)
  7. getShortDateTimeString(Date date)
  8. getShortFormat(Date date)
  9. getStringFromDate(Date date)