same same on cf8, too.
if first month of the 2 has 31 days the diff is 1, but if it
is a month
that has 30 days the diff is 0:
<cfset dd = createdate(2009, 5, 31)>
<cfset dd2 = dateadd('m', 1, dd)>
<cfoutput>
#dd# - #dd2#<br>
datediff('m', dd, dateadd('m',1,dd) ) : #datediff('m', dd,
dateadd('m',1,dd) )#<!--- returns 1 --->
</cfoutput>
<cfset dd = createdate(2009, 6, 30)>
<cfset dd2 = dateadd('m', 1, dd)>
<cfoutput>
#dd# - #dd2#<br>
datediff('m', dd, dateadd('m',1,dd) ) : #datediff('m', dd,
dateadd('m',1,dd) )#<!--- returns 0 --->
</cfoutput>
not sure if it os odd or not though...
from datediff() docs:
"The DateDiff function determines the number of *complete
datepart
units* between the two dates; for example, if the
datepart parameter is "m" and the dates differ by 55 days,
the function
returns 1."
so, maybe, CF (and Java, too, i presume?) sees it as no FULL
month is
encompassed when the first date has 30 days and the second
has 31 days?
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/