This had me stumped for a while. You should be able to make use of this
<cfset dateString = "Thursday, October 9, 2003 1:16:58 PM CDT"> <cfset dateObj = ParseDateTime(dateString)> <cfdump var="#DateCompare(dateObj, Now())#"> ParseDateTime() should work in turning "Thursday, October 9, 2003 1:16:58 PM CDT" into a date[time] object which is needed for DateCompare(). Ade -----Original Message----- From: Scot VanAlstine [mailto:[EMAIL PROTECTED] Sent: 29 March 2005 13:57 To: CF-Newbie Subject: converting file dates read with cf directory 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> -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 27/03/2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Protect Your PC from viruses, hackers, spam and more. Buy PC-cillin with Easy Installation & Support http://www.houseoffusion.com/banners/view.cfm?bannerid=61 Message: http://www.houseoffusion.com/lists.cfm/link=i:15:787 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
