James Blaha wrote:
> 
> Is below the best and only way to easily find out how many days are 
> between 2 dates? Im writing a template for a file backup where files 
> that are older then 5 day will be deleted and Im not sure what the 
> easiest best practice approach would be for the days check.
> 
> <cfoutput>#Abs("#DateDiff("d","6/3/03","#DateFormat(NOW(), 
> "M/D/YY")#")#")#</cfoutput>

6/3/03 is ambiguous, use a format of yyyy-mm-dd. You have way to many 
quotes and ##'s. And you don't need to DateFormat() the Now():

#Abs(DateDiff("d", "2003-03-06", Now()))#

Jochem


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to