Hi all,

Am I going mad or is there something I'm missing.... If I run the
following code:

<cfloop from="0" to="5" index="i">
<cfset tempdate=dateadd('d',i,'26-mar-2004')>
<cfset temp2 = '31-mar-2004'>
#i#: #tempdate# to #temp2#: #datediff('d',tempdate,temp2)#<br>
</cfloop>

I get the following output:

0: {ts '2004-03-26 00:00:00'} to 31-mar-2004: 4
1: {ts '2004-03-27 00:00:00'} to 31-mar-2004: 3
2: {ts '2004-03-28 00:00:00'} to 31-mar-2004: 2
3: {ts '2004-03-29 00:00:00'} to 31-mar-2004: 2
4: {ts '2004-03-30 00:00:00'} to 31-mar-2004: 1
5: {ts '2004-03-31 00:00:00'} to 31-mar-2004: 0

So my question is: why is the difference the same between
28-mar-2004/31-mar-2004 as it is for 29-mar-2004/31-mar-2004, ie 2 days?

Any help would be much appreciated...

Alex
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to