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.
How can i check that if a date is in a particular format like
Share
You could try to parse the date with
SimpleDateFormat. If it works the date is in the expected format.