Here you can find the source of isValidDate(String date, String dateFormat)
public static boolean isValidDate(String date, String dateFormat)
//package com.java2s; import java.text.SimpleDateFormat; public class Main { public static boolean isValidDate(String date, String dateFormat) { try {/*from w w w . jav a2 s . c o m*/ new SimpleDateFormat(dateFormat).parse(date); return true; } catch (Exception e) { return false; } } }