May 19, 2022
CreateODBCDateTime function gives an error on 1 specific date input
Comments
(1)
May 19, 2022
CreateODBCDateTime function gives an error on 1 specific date input
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 Workarounds:
Not that we know of.

Any Help on this issue will be greatly appreciated.

1 Comment
2022-06-14 16:26:39
2022-06-14 16:26:39

Try to duplicate the error – no error as a result.

Article mentions: daylight saving, SetTimeZone, lsParseDateTime 

Coldfusion 2021 Date value passed to date function createDateTime is unspecified or invalid – Specify a valid date in createDateTime function – Stack Overflow

 

Like
()
Add Comment