Here you can find the source of isDateTwo(String value)
Parameter | Description |
---|---|
value | a parameter |
private static boolean isDateTwo(String value)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*from ww w . ja v a 2 s . co m*/ * * qli comment the method "isDateTwo". * * @param value * * @return boolean */ private static boolean isDateTwo(String value) { if (value != null) { try { String dateFormat = "yyyy-MM-dd";//$NON-NLS-1$ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); Date dt = simpleDateFormat.parse(value); simpleDateFormat.format(dt); return true; } catch (ParseException pe) { return false; } } else return false; } }