Reputation: 1614
How can i check that if a date is in a particular format like "dd/MM/yyyy" then it will do something but if it is not in this format or if a string like "NA" is there or whatever is there it should throw an error.
Upvotes: 2
Views: 2922
Reputation: 204756
You could try to parse the date with SimpleDateFormat
. If it works the date is in the expected format.
Upvotes: 3