Yea, my first attempt was something similar:

CreateDate(Left(pubDate,2),Mid(pubDate,3,2),Right(pubDate,2))

but it throws errors (unspecified ones at that)

So does this, weirdly enough:

<cfset FileName = "01-122906WASH-CIRC.txt">

<cfset pubDate = Mid(FileName,4,6)>

<cfset month = Left(pubDate,2)>
<cfset day = Mid(pubDate,3,2)>
<cfset year = Right(pubDate,2)>



<cfset pubDate = CreateDate(month,day,year)>

<cfoutput>#month#/#day#/#year# - #pubDate#</cfoutput>



On 6/15/07, Adkins, Randy <[EMAIL PROTECTED]> wrote:
>
> May not be the most efficient way but:
>
> CreateDate(MID(myString,5,2), MID(myString,3,2), MID(myString,1,2))
>
>
> -----Original Message-----
> From: Ray Champagne [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 15, 2007 12:05 PM
> To: CF-Talk
> Subject: converting a string to a date - most efficient way?
>
> So, I have a file that I am uploading that contains a string that
> represents the date, and I need to extract the date from the filename.
> I have the extraction down to a string that looks like MMDDYY (ex:
> 120507) and I need to turn that into an ODBC date in the most efficient
> way possible.
>
>
>
> I've got a few ideas, but they all basically suck.  Any takers?
>
>
>
> --
>
> Ray Champagne
>
> Web Developer, Dolan Media Company
>
> 612.215.6497 :: 612.718.8852 (m)
>
> ray.champagne [at] dolanmedia [dot] com
>
> GTalk: raychampagne
>
>
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

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

Reply via email to