Here you can find the source of isLocalDate(String value, DateTimeFormatter formatter)
public static boolean isLocalDate(String value, DateTimeFormatter formatter)
//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; } } }