Here you can find the source of isDateValue(String inputString)
Parameter | Description |
---|---|
inputString | a parameter |
public static boolean isDateValue(String inputString)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { /**/*from w ww . jav a 2 s . c o m*/ * DOC zqin Comment method "isDateValue". * * @param inputString * @return */ public static boolean isDateValue(String inputString) { if (!isEmpty(inputString)) { try { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$ df.setLenient(false); df.parse(inputString); return true; } catch (Exception e) { return false; } } return false; } /** * DOC Zqin Comment method "isEmpty". * * @param strs * @return */ public static boolean isEmpty(String... strs) { if (strs == null) { return false; } for (String str : strs) { if (str == null) { return true; } else if ("".equals(str.trim())) { //$NON-NLS-1$ return true; } } return false; } }