Java LocalDate Format formatLocalDate(LocalDate date)

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

Description

format Local Date

License

Open Source License

Declaration

public static Optional<String> formatLocalDate(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.util.Optional;

public class Main {
    private static DateTimeFormatter DEFAULT_DATE_FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE_TIME;

    public static Optional<String> formatLocalDate(LocalDate date) {
        if (null == date) {
            return Optional.empty();
        }//from   ww w. j a  v  a  2 s. co m
        return Optional.of(DEFAULT_DATE_FORMATTER.format(date));
    }
}

Related

  1. changeLocalDateToFormattedString(LocalDate value)
  2. dateToString(LocalDate date, DateTimeFormatter formatter)
  3. doesParsedDateMatchText(LocalDate parsedDate, String text, Locale formatLocale)
  4. format(final LocalDate source)
  5. formateDate(LocalDate date, String formatStr)
  6. formatLocalDateJsr310ForJsonPath(LocalDate date)
  7. formatToIsoLocalDate(LocalDate date)
  8. getDateFormatForLocalDate()
  9. getDateStartFormat(LocalDate localDate)