CreateODBCDateTime function gives an error on 1 specific date input. Date is being input as a string
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.
Try to duplicate the error – no error as a result.
Article mentions: daylight saving, SetTimeZone, lsParseDateTime
You must be logged in to post a comment.