Manipulation of Date in Shell

Reuirement:
I have a set of files ina diectory which has the name in format "WWW-YYYYmmDD"
like, WWW-20070226. for 26th FEB 2007.
Now I need to write a shell script which should move the files to directory named "old" in the same directory if date attached to file is 90 days prior to today's date.

Now can you please tell me how to extract the date from the file name & how to come to conclusion that the difference is 90 days?

One approach I am thinking of is:
Converting both the dates to epoch & then comparing epochs has difference of 90 days (90*24*60*60) or not?

But again, the thing is how to convert the 'extracted date' & 'today's date' to epoch?:confused:

If anybody is thinking of different aproach, please respond...

Have you looked in the FAQ for 'Date Arithmetic'? There is a datecalc script by Perderabo that does what you need....