Check for the correct date format in UNIx

Hi All,
I am getting two input from User for Date from the command prompt when
my script is executed .
The date format i am taking is : DD-MM-YYYY
so is there any method in Unix to validate the two input date.
There might be many cases for these two date to be invalid. Few are :
Date1 is Greater than Date2.
The format of date1 and Date2 is not correct.
The DD can be more than 31.
Similarly for month.

Thanks
rawat

Have you written a script before? If not, then you can start with this. There is no direct way you can do this verification with a single command. You will have to split up the YYYY, MM and DD and then check if they satisfy your requirements. You will have to do this for both the dates.
Then you can compare the dates to check for that date1 greater than date2 error. Use the split up forms of the two dates for this as well. Check for the year first, then the month and then the day.