I think you will have to do Ben's parsing as below if you have the dates in 
that format "20061129041148".  Using CreateODBCDateTime or CreateDateTime on 
that string as it stands does not return the desired result.

-- Josh


----- Original Message ----- 
From: "Ben Forta" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, November 29, 2006 3:29 PM
Subject: RE: DateDiff weirdness


> Seems to work, the following returns 9, as it should
>
> <cfset s1="20061129041148">
> <cfset s2="20061129041157">
>
> <cfset d1=CreateDateTime(Left(s1, 4),
> Mid(s1, 5, 2),
> Mid(s1, 7, 2),
> Mid(s1, 9, 2),
> Mid(s1, 11, 2),
> Mid(s1, 13, 2))>
> <cfset d2=CreateDateTime(Left(s2, 4),
> Mid(s2, 5, 2),
> Mid(s2, 7, 2),
> Mid(s2, 9, 2),
> Mid(s2, 11, 2),
> Mid(s2, 13, 2))>
>
> <cfoutput>
> #DateDiff("s", d1, d2)#
> </cfoutput>
>
> --- Ben
>
>
>
> -----Original Message-----
> From: Munson, Jacob [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 29, 2006 6:17 PM
> To: CF-Talk
> Subject: DateDiff weirdness
>
> I have a date value in this format: yyyymmddhhmmss, for example
> 20061129041148.  What I need to do is calculate the difference in seconds
> between this date and now().  So I figured I'd use
> createDateTime() to turn it into a valid date/time object, and then use
> dateDiff().  However, doing that I get a huge difference returned, like
> 43529, when there are truly only 5 seconds between the two date/times.
> Any ideas?
>
>
>
>
>
>
> ----------------------------------------------------------------------------
> --
> This transmission may contain information that is privileged, confidential
> and/or exempt from disclosure under applicable law. If you are not the
> intended recipient, you are hereby notified that any disclosure, copying,
> distribution, or use of the information contained herein (including any
> reliance thereon) is STRICTLY PROHIBITED. If you received this 
> transmission
> in error, please immediately contact the sender and destroy the material 
> in
> its entirety, whether in electronic or hard copy format. Thank you.
>
> ============================================================================
> ==
> "EMF <idahopower.com>" made the previous annotations.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262144
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to