How to confirm a date format yyyymmdd in unix?

Hullboy

Member
Apr 18, 2001
172
0
0
Hi

Can't believe I'm having to ask this one, but a search on google groups turned up nothing.

How can I check that a string is of valid format yyyymmdd? I know I can see if it is of the pattern nnnnnnnn but is there a program already there to check that the date is valid i.e. not 20020245 or something like that!

Thanks!