Hi,
I would guess you're running MX6.1, the zero represents milliseconds...

On MX6.1 this will correctly output the difference as 3 seconds.

<cfset a="2004-09-08 12:28:56.0">
<cfset b="2004-09-08 12:28:59.0">
<cfoutput>
<p>difference in seconds=#dateDiff("s",a,b)#
</cfoutput>

Andrew.

> Hello everybody,
>
> I'm working on this script to get the date difference between two
> dates in minutes. After doing that; I want to then deduct/subtract the
> value returned by the datediff function from another date value.
>
> Here is what I'm trying to do:

>
> Reading the two date values from a table:
>
> <cfset timeCallPlacedOnHold = queryTmp.HoldDateTime>
> <cfset timeOnHoldReleased = queryTmp.ReleasedDateTime>
>
> For some reason the dates retuned are in this format:
>
> Ex: "2004-09-08 12:28:56.0"
>
> I can't understand why it adds the ".0" after the time when the value
> stored in the database is "2004-09-08 12:28:56"
>
>
> <!--- Date diff in minutes --->
> <cfset totalDateDiff = datediff("n",TimeCallPlacedOnHold,
> TimeOnHoldReleased)>
>
> Now, I'm taking the value returned by the dateDiff function and
> subtracting it from another date
>
> DateAdd("n",-totalDateDiff,queryTmp.FixDateTime)
>
> The dates returned are not correct. I don't want I'm doing wrong. Can
> somebody please point out what I should be doing to correct this.
>
> Best regards
cfcoder
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to