Here you can find the source of getFormattedDateString(LocalDate date)
Parameter | Description |
---|---|
LocalDate | date to be formatted |
public static String getFormattedDateString(LocalDate date)
//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(); } }