May 19, 2022
CreateODBCDateTime function gives an error on 1 specific date input. Date is being input as a string
Comments
(1)
May 19, 2022
CreateODBCDateTime function gives an error on 1 specific date input. Date is being input as a string
Newbie 2 posts
Followers: 0 people
(1)

Problem Description:
The issue is being experienced with the following code:

<cfoutput>
<cfset mydate = ‘June 01, 2008’>
<cfset JobStartDate=CreateODBCDateTime(mydate)>
#JobStartDate#
</cfoutput>

When we run the code we get the following error:

“Date value passed to date function createDateTime is unspecified or invalid”

The code works fine if we change the mydate variable to any other date say June 02, 2008. The same code as it is with the same date works on CFFiddle.org and it also works on ColdFusion 11 which we have installed on another server. But it does not work on ColdFusion 2021 installed in our environment. We really need this to work on CF2021.

Steps to Reproduce:

Actual Result:
Error: Date value passed to date function createDateTime is unspecified or invalid

Expected Result:
{ts ‘2008-06-01 00:00:00’}

Any Help on this issue will be greatly appreciated.

1 Comment
2022-06-24 19:12:18
2022-06-24 19:12:18

It looks like this was posted and a fix was found on StackOverflow.

The link to the Q&A is here: https://stackoverflow.com/questions/72345620/coldfusion-2021-date-value-passed-to-date-function-createdatetime-is-unspecified.

Like
Add Comment