Here you can find the source of isValidateData(String val)
public static boolean isValidateData(String val)
//package com.java2s; /*//from w ww .j a va 2s . c o m * Distributable under LGPL v3 license. * See terms of license at https://github.com/Yunfeng/schotel/blob/master/LICENSE */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isValidateData(String val) { try { convertToDate(val, "yyyy-MM-dd"); return true; } catch (Exception ex) { return false; } } public static Date convertToDate(String val, String format) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.parse(val); } public static Date convertToDate(String val) throws ParseException { return convertToDate(val, "yyyy-MM-dd"); } }