There are three parameters to pass to the BIF DateDiff()

datePart
Date1
Date2

Date1 and date2 need to be dates.

When you passed in "Now()" and "deadline", it was passing the literal string "Now()" 
and the literal string "deadline".

If you want to pass the values of now() and deadline, you need to pass them without 
quotes, or by outputing the value using coldFusion #

So

dateDiff("s",now(),deadline)

or 

dateDiff("s","#now()#","#deadline#")

This assumes the variable deadline is defined and evaluates to a date.

Jerry Johnson

>>> [EMAIL PROTECTED] 02/13/03 05:08PM >>>
sorry charlie but i get the same error:(


----- Original Message -----
From: "charlie griefer" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, February 13, 2003 5:07 PM
Subject: Re: OK, lets start over........Re: any ideas on this error?


> no quotes around now()
> <cfset timeLeft = dateDiff("'s'", now(), "deadline")>
>
>
> Dave Lyons writes:
>
> > heres what i need
> >
> > i have to make this small auction page for my competitors client.
> > what i need right now is to be able to show on the details page how much
> > time is left before the end of the auction.
> > see: http://www.real-singles.com/auctionCFM/detail.cfm?auctionID=25 
> >
> > ok, so in my application.cfm template i have this variable set:
> > <cfset deadline = createDateTime(2003, 2, 15, 13, 42, 0)>
> >
> > the reason for this is that i need this to manually set the end time of
the
> > auction on all of the pages.
> > they arent paying enough to make it dynamic and they want each auction
to
> > start and end all at the same time, just a 1 shot deal.
> > but I figure i should use this for what i need now.
> >
> > so on the details page i need to basically show how much time is left,
just
> > like Ebay:)
> >
> > thats where dateDiff comes in, correct?
> >
> > which should be like such
> > <cfset timeLeft = DateDiff("datepart", "date1", "date2")>
> >
> > so i was thinking that Now() should go where "date1" is
> > And "deadline" from the application.cfm should go where "date2" is
> > tony i think you may be right in putting 's' in where "datePart" is
> >
> > which now looks like
> >
> > <cfset timeLeft = DateDiff("'s'", "Now()", "deadline")>
> >
> > and that produces this error
> >
> >  Parameter validation error for function DATEDIFF.
> >       The value of the parameter 2, which is currently "Now()", must be
a
> > class java.util.Date value.
> >
> >       The error occurred in C:\Inetpub\wwwroot\auctionCFM\datediff.cfm:
line
> > 14
> >
> > 12 :
> > 13 : <body>
> > 14 : <cfset timeLeft = DateDiff("'s'", "Now()", "deadline")>
> > 15 :
> > 16 :
> >
> >
> >
> >
> >
> >
> >
> >
> > Dave
> >
> > ----- Original Message -----
> > From: "Tony Weeg" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 13, 2003 4:40 PM
> > Subject: RE: any ideas on this error?
> >
> >
> >> send the code ur using....
> >>
> >> ...tony
> >>
> >> Tony Weeg
> >> Senior Web Developer
> >> UnCertified Advanced ColdFusion Developer
> >> Information System Design
> >> Navtrak, Inc.
> >> Mobile workforce monitoring, mapping & reporting
> >> www.navtrak.net 
> >> 410.548.2337
> >>
> >> -----Original Message-----
> >> From: Dave Lyons [mailto:[EMAIL PROTECTED]] 
> >> Sent: Thursday, February 13, 2003 4:36 PM
> >> To: CF-Talk
> >> Subject: Re: any ideas on this error?
> >>
> >>
> >> using just Now() throws the same error
> >>
> >>
> >> Dave
> >>
> >> ----- Original Message -----
> >> From: "Tony Weeg" <[EMAIL PROTECTED]>
> >> To: "CF-Talk" <[EMAIL PROTECTED]>
> >> Sent: Thursday, February 13, 2003 4:30 PM
> >> Subject: RE: any ideas on this error?
> >>
> >>
> >> > why use all that....can u just use
> >> >
> >> > Now()
> >> >
> >> > ...tony
> >> >
> >> > Tony Weeg
> >> > Senior Web Developer
> >> > UnCertified Advanced ColdFusion Developer
> >> > Information System Design
> >> > Navtrak, Inc.
> >> > Mobile workforce monitoring, mapping & reporting
> >> > www.navtrak.net 
> >> > 410.548.2337
> >> >
> >> > -----Original Message-----
> >> > From: Dave Lyons [mailto:[EMAIL PROTECTED]] 
> >> > Sent: Thursday, February 13, 2003 4:26 PM
> >> > To: CF-Talk
> >> > Subject: any ideas on this error?
> >> >
> >> >
> >> >       Parameter validation error for function DATEDIFF.
> >> >       The value of the parameter 2, which is currently
> >> > "CreateDateTime(Now())", must be a class java.util.Date value.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at http://www.coolfusion.com

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

Reply via email to