who is gilbert arenas dating now - Code for validating date in java

by  |  03-Oct-2017 08:22

code for validating date in java-57

User might enter date in format “dd/mm/yyy” or “dd-mm-yyyy” or “yy”! It runs through each format from the list and check weather input string is valid date or not.

If it fails to convert String to Date then it returns null.

My earlier post on how to validate email address, SSN and phone number validation using Java regex still attracts lot of visitors.

Today I realized that another piece of data that many programmers need to validate is the date.

I'm looking to increase the conciseness of this code.

Community Discussion