Java LocalDate Format isLocalDate(String value, DateTimeFormatter formatter)

Here you can find the source of isLocalDate(String value, DateTimeFormatter formatter)

Description

is Local Date

License

Open Source License

Declaration

public static boolean isLocalDate(String value, DateTimeFormatter formatter) 

Method Source Code

//package com.java2s;
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import java.time.LocalDate;

import java.time.format.DateTimeFormatter;

public class Main {
    public static boolean isLocalDate(String value, DateTimeFormatter formatter) {
        try {//from  www  .  jav  a2s . c om
            LocalDate.parse(value, formatter);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. formatToIsoLocalDate(LocalDate date)
  2. getDateFormatForLocalDate()
  3. getDateStartFormat(LocalDate localDate)
  4. getFormattedDateString(LocalDate date)
  5. getLocalDate(String dateStr, String formatStr)
  6. parseToLocalDate(String format, String date)