Java Date to Long formatDateLong(Date date, Locale locale)

Here you can find the source of formatDateLong(Date date, Locale locale)

Description

Formats the specified date using the DateFormat#LONG format and the specified locale.

License

MIT License

Parameter

Parameter Description
date a date to format.
locale a locale.

Return

the formatted date.

Declaration

public static String formatDateLong(Date date, Locale locale) 

Method Source Code

//package com.java2s;
/*/*  w w w .  j a va 2 s.  co  m*/
 * Copyright (c) 2015-2016 QuartzDesk.com.
 * Licensed under the MIT license (https://opensource.org/licenses/MIT).
 */

import java.text.DateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    /**
     * Formats the specified date using the {@link DateFormat#LONG} format and the specified locale.
     *
     * @param date   a date to format.
     * @param locale a locale.
     * @return the formatted date.
     */
    public static String formatDateLong(Date date, Locale locale) {
        return DateFormat.getDateInstance(DateFormat.LONG, locale).format(date);
    }
}

Related

  1. dateToLong(Date date)
  2. dateToNumber(Date date)
  3. formatDateToLong(Date date, String format)
  4. formatDateToLong(String strDate, String formatstr)