You can definitely get the time when the file was created as a Dispatch variable, and the time when the current file was modified. However, I'm not sure how this reports out, and whether you'd be able to subtract between the two.
You may be better off running a search between date ranges every few weeks and deleting as required.
I think i remember from a previous request, working with dates in Dispatch (or in a data card for that matter) will not work because it recognizes the date as a number, and subtraction will almost never give you a correct result. Especially if your date span includes the end of a month and beginning of the next. In my case playing with dates and subtraction in data card (norwegian standard date dd.mm.yyyy):
All good so far, then:
So it recognizes the day and month as a number with 2 decimals, and then just subtracts.
Switch to US standard (mm.dd.yyyy):
There is not enough detail that describes what you are trying to do.
Are the file in a 'private state' (eg: added to the vault but not checked in?)
Are they checked in?
What do you want to happen if the files have references?
Do you want 'delete' or 'destroy'?
Regardless of the answers to the above questions, Dispatch is the wrong tool for this - in my opinion :-).
It lacks date functions and error trapping.
You need to perform date functions which are best done with T-SQL which can then be put into a report if desired.
But, ultimately, you may need to use the API to handle decision logic.
Here is a sample report that shows how to use date difference functions to find how long documents have been in a state.
RPT_DaysinState.crp.zip 883 bytes
You could look at the Cold Storage function in the PDM Administration tool. It has the ability to delete the files as well as moving them to another location.