Here you can find the source of formatLocalDate(LocalDate date)
public static Optional<String> formatLocalDate(LocalDate date)
//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)); } }