Now() is simply a number (equivalent to the number of seconds that have
passed since December 31, 1899 if I'm not mistaken). The DateAdd function
simply adds the two numbers that you enter. So, there really is no problem
with the order that you enter the parameters since it's just the addition of
two number...
HTH,
Howie Hamlin
--
inFusion Project Manager; On-Line Data Solutions, Inc. (631)737-4668
===================================================
Please vote for iMS in the Most Innovative category here:
*** http://www.sys-con.com/ColdFusion/readerschoice2000/ ***
===================================================
Check out inFusion Mail Server - the world's most configurable email server
*** inFusion Authenticator for IIS is now released! (download from
CoolFusion.com) ***
http://www.teletrends.com and http://www.coolfusion.com
Software and utilities for ColdFusion, iHTML, Website, NTMail
Latest versions available from our web site (inFusion Authenticator version
2.0 for WebSite and NTMail is now released)
----- Original Message -----
From: Jeff Beer <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 24, 2000 11:25 AM
Subject: Odd date function behavior
> Hello all,
>
> Using the following
>
> cfset olddate = DateFormat(DateAdd("d", -30, Now()))
>
> works as expected.
>
> What's odd is the original code was written like this:
>
> cfset olddate = DateFormat(DateAdd("d", Now(), -30))
>
> This didn't produce an error, either in the cfset, or in the query where
> 'olddate' was used.
>
> Both formats return 3/25/2000.
>
> From the docs, the correct syntax is DateAdd(datepart, number, date), as
in
> the first example.
>
> Am I missing something here?
>
>
>
> ---------------------
> Jeff Beer
> Programmer
> Hydrogen Media, Inc.
> www.hydrogenmedia.com
> Phone: 888.890.9175
> Fax: 727.530.5588
>
>
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.