Only use dateformat() for display.   Don't use it in conjunction with
DateAdd() or DateCompare().  DateFormat turns the date from a date to a
formatted string.

-----Original Message-----
From: Joy Holman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 06, 2008 3:09 PM
To: CF-Talk
Subject: Re: Need to add 4 hours to a variable and compare to Now()

Thanks for your responses.
I've actually been working with the Date and Time functions in CF.
I can't seem to get any code to work that adds 4 hours to the variable.

For instance:
1.)<CFIF....
IsDefined("application.startFacTime") AND (
        
DateCompare(DateFormat(application.startFacTime),DateFormat(now())) is 0 AND
DateCompare(Hour(application.startFacTimeMin),Hour(now())) is -1> 

This works to compare the variable to Now, but that doesn't do any good.

I need something like this pseudo-code:

DateCompare(Hour(application.startFacTimeMin)+4 hours,Hour(now())) is -1



2.) This "works" but, like above, it doesn't do me any good:
<CFIF....
        DateCompare(application.startFacTime,DateFormat(now())) is 0 AND 
   #Abs(DateDiff('h', application.startFacTime, Dateformat(now())))# lt 1
</cfif>

I need something like this pseudo-code:
#Abs(DateDiff('h', application.startFacTime + 4 hours, Dateformat(now())))#
lt 1

Thanks for your help.

        



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300670
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to