I am reading the last modified date of files in a directory and trying to a
date compare to eliminate files over 60 days old.
I have the code BUT it is dying because it cannot convert the date.
So far I have found nowhere on the net that has the answer.
This is the latest version of coldfusion. I am in the US and the server is
running UNIX.
Here is the error:
The value "Thursday, October 9, 2003 1:16:58 PM CDT" could not be converted to
a date.
Here is the code:
<CFSET logPath = "#application.logPath#">
<CFDIRECTORY ACTION="List" DIRECTORY="#logPath#" NAME="dir_listing">
<cfloop query="dir_listing">
<cfif dateCompare(dateAdd("d",60,datelastmodified),now()) LTE 0>
<cffile action="DELETE" file="#logPath#/#name#">
</cfif>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:786
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54