file attributes and exception

hi,
I want to know the date the file was created or modified. I can do this using ls, ll -ltr etc...
I want to do this in a function (so If the file date is older then a week I can report it), is there a way?

another thing...
In sql function, I can catch exceptions, is there a way to do this in unix ?

First off what do you mean by exception int this context? Shells and unix commands don't throw exceptions, they suceed or fail with exist status of 0 or non-zero respectively.

For the date question, see 'man find'