Newbie Date Conversion/Comparison Question
I am trying to compare the date of a file with the current time using this code
<cfset myPath = "C:\path\to\myfile.txt" >
<cfset myExists=Fileexists(myPath)>
<cfSet TIMEOUT="#DateAdd("h", "-6", Now() )#" >
<cfset myFile = CreateObject("java", "java.io.File")>
<cfset myFile.init(myPath)>
<cfset last_modified = myFile.lastModified()>
<cfif (TIMEOUT lt last_modified) or (not myExists)>
if myPath does not exist or it is at least 6 hours old regenerate the file
</cfif>
My problem is the DateAdd function creates the date/time in a {ts xxx} format while the .lastModified function creates a time stamp in a millisecond format.
What function do I use to compare these two different time stamps?
