tracker issue : CF-3700847

select a category, or use search below
(searches all categories and all time range)

createOdbc~() functions do not do what they say on the tin

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 01/29/2014

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Minor / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 26, 2019 using build 2016.0.01.298513

createOdbcDate() maintains the time components of the passed-in value; and createOdbcTime(0 maintains the date components. They should not.


----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3700847

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:



I recently came up with a use case for this in ACF (10) and found it to be very frustrating. I converted a datetime to a date using newDate= createODBCDate(olddatetime) because I wanted to do some "number of days" calculations on an event that had a specific start time. I thought this would be a simple way of doing this in code (normally I would do this in the database, but for a variety of reasons, it wasn't practical to do in this case). So after doing this: newDate= createODBCDate(olddatetime) I did some dateAdd("d", dayInterval, newDate) operations. Expecting this to be a date object (or at least a timeDate object with the time set to 00:00:00, I went on my merry way. Very surprised to find the original date injected into my results.
Vote by External U.
13585 | February 03, 2015 06:10:38 AM GMT
Fix verified in ColdFusion build #294196 (Comment added from ex-user id:duttswam)
Comment by Adobe D.
13583 | June 18, 2015 01:20:28 AM GMT
Current link for the referenced article is:
Comment by External U.
13584 | July 16, 2015 06:49:13 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). CreateODBCDate()'s time components are now 00:00:00, and CreateODBCTime()'s date components are now 1/1/1970. Thanks!, -Aaron
Comment by Aaron N.
31211 | August 26, 2019 12:31:24 AM GMT