Java LocalDate Format getFormattedDateString(LocalDate date)

Here you can find the source of getFormattedDateString(LocalDate date)

Description

format the LocalDate in "dd.MM.yyyy-XX" format

License

Open Source License

Parameter

Parameter Description
LocalDate date to be formatted

Return

a string representing time in "dd.MM.yyyy-XX" format

Declaration

public static String getFormattedDateString(LocalDate date) 

Method Source Code

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

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;

import java.util.Locale;

public class Main {
    private static final DateTimeFormatter germanFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)
            .withLocale(Locale.GERMAN);

    /**/*from w  w w. ja  v  a 2  s .c  om*/
     * format the LocalDate in "dd.MM.yyyy-XX" format
     * 
     * @param LocalDate
     *            date to be formatted
     * @return a string representing time in "dd.MM.yyyy-XX" format
     */
    public static String getFormattedDateString(LocalDate date) {
        return germanFormatter.format(date).toString();
    }
}

Related

  1. formatLocalDate(LocalDate date)
  2. formatLocalDateJsr310ForJsonPath(LocalDate date)
  3. formatToIsoLocalDate(LocalDate date)
  4. getDateFormatForLocalDate()
  5. getDateStartFormat(LocalDate localDate)
  6. getLocalDate(String dateStr, String formatStr)
  7. isLocalDate(String value, DateTimeFormatter formatter)
  8. parseToLocalDate(String format, String date)