I am getting input as two types.
1.String date1 = \"07/01/2017\"; 2.String date2 = \"\"2017-01-12 00:00:00.0\";
How to compare two date formats
If you want to know if the date is in format mm/dd/yyyy or mm-dd-yyyy or something in the same idea, you probably need to use regex expressions.
You can check this for a way to implement it What is the regular expression for Date format dd\mm\yyyy?