Okay, I am probably splitting hairs over here, but I ran into an icky situation with the native ColdFusion function DateDiff() today and just thought I'd check whether anyone else has experienced this before.
Basically, I wrote a CF Scheduled Task that is supposed to go to a directory and delete all PDF files that are created before today. Simple enough, right? It should be really, but the DateDiff() function is behaving strangely. Try running the code below: <cfset variables.yesterday = "04-04-2010 11:59 PM"> <cfset variables.today = "04-05-2010 12:01 AM"> <cfoutput>today - yesterday = #dateDiff("d",yesterday,today)#</cfoutput> You see how it thinks the the date difference is ZERO??? Shouldn't it be ONE???!!! There are ways to get around this (elegantly or otherwise)... but now I am just irked and curious. Is this expected behavior and I am just not understanding the function correctly or is this a bug that should get fixed? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332613 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm