What I was saying is, I tested the actual code you originally posted on CF9
with 08:38:49 Apr 11, 2012 PDT as the input and it works fine. I was trying
to verify that the data you're working with has the timezone on the end,
since the "cut" portion of the code is designed to remove that, and will
remove needed data if your input doesn't include it. I just tested again
with 08:38:49 April 11, 2012 EST, and your original code also works.
Removing the "cut" won't fix your trouble, because 08:38:49 April 11, 2012
EST isn't a valid date/time string for CF.

I used this for my testing:
<form method="post">
<input type="text" name="payment_date" value="08:38:49 Apr 11, 2012  EST "
/>
<button>Post</button>
</form>

<cfif isdefined("form.payment_date")>
       <cfset payment_date=urldecode(form.payment_date)>
       <cfset dl = len(payment_date)>
       <cfset cut = dl - 3>
       <cfset paymentdate_temp=removechars(payment_date,cut,4)>
      <cfset paymentdate = #createodbcdatetime(paymentdate_temp)#>
<cfdump var="#paymentdate#">
</cfif>


I noticed that the date im trying to create an odbc datetiime on is
> "08:38:49 Apr 11, 2012" and its failing.. That still has the time in it but
> not the EST.
>

This should work fine: <cfdump var="#createodbcdatetime('08:38:49 Apr 11,
2012')#">

You may be running into an ambiguity issue with CF being type-less.
Createodbcdatetime() wants a DateTime object but will accept a string CF
thinks it can parse. For my test environment, CF can parse the string you
have, but it seems your server environment can't. I can't say for sure why,
and getting into the server settings isn't really something I have a lot of
experience with.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350683
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to