public static boolean isValidDate(String str) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try{ Date date = (Date)formatter.parse(str); return str.equals(formatter.format(date)); }catch(Exception e){ return false; } }
public static boolean isValidDate(String str) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try{ Date date = (Date)formatter.parse(str); return str.equals(formatter.format(date)); }catch(Exception e){ return false; } }