How could I compare these dates from the directory names if they are 45 days older than today's date. With the dates above I would have to delete 09052011 directory because its 45 days older than today's date.

Then, just generate the string for the day 45 days ago and remove everything lesser.How to find what that days' date was? How yould you proceed without a computer? Would you calculate the date, or just have a look into a calendar?