Here you can find the source of isDate(String input)
Parameter | Description |
---|---|
input | a parameter |
public static boolean isDate(String input)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String DATE_FORMAT = "dd/MM/yyyy"; /**/*from w ww. j a v a 2 s. c o m*/ * is date * * @param input * @return boolean */ public static boolean isDate(String input) { try { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); Date d = sdf.parse(input); return true; } catch (ParseException ex) { return false; } } }