Monthly Archives: October 2006

Date Objects vs Date Strings in ColdFusion

To use dates effectively in ColdFusion it is important to understand when you are dealing with dates represented internally as Strings and when you are dealing with dates represented internally as date Objects. This is particularly important when dealing with non US dates formats. So how do you know when you are using a date [...]
Posted in ColdFusion | Tagged | Comments closed

Getting a file’s timestamp using ColdFusion

Finding a file’s date/time is now quite easy in ColdFusion by simply making use of the underlying Java File and Date objects. A bit of code … <cfset filePath = "datamyfile.txt"> <cfset fileObj = createObject("java","java.io.File").init(expandPath(filePath))> <cfset fileDate = createObject("java","java.util.Date").init(fileObj.lastModified())> At this point the fileDate variable contains a normal ColdFusion date. Couple of notes: The java.io.File [...]
Posted in ColdFusion | Tagged , | Comments closed