Java Utililty Methods LocalDate Format

List of utility methods to do LocalDate Format

Description

The list of methods to do LocalDate Format are organized into topic(s).

Method

StringgetFormattedDateString(LocalDate date)
format the LocalDate in "dd.MM.yyyy-XX" format
return germanFormatter.format(date).toString();
LocalDategetLocalDate(String dateStr, String formatStr)
get Local Date
if (Strings.isNullOrEmpty(dateStr)) {
    return null;
final DateTimeFormatter dtf = DateTimeFormatter.ofPattern(formatStr);
TemporalAccessor temp = dtf.parse(dateStr);
return LocalDate.from(temp);
booleanisLocalDate(String value, DateTimeFormatter formatter)
is Local Date
try {
    LocalDate.parse(value, formatter);
    return true;
} catch (Exception e) {
    return false;
LocalDateparseToLocalDate(String format, String date)
parse To Local Date
return parseToLocalDate(DateTimeFormatter.ofPattern(format), date);