The functions IsDate() / LSIsDate() / ParseDateTime() / LSIsDate() require that you provide a string to these functions. However these functions do not throw an exception if you provide a date/time object. Not only this - they return inconsistent results if you use an object - often it works, but not always. So you may feel like the function allows an object as param and you learn later the hard way that your code is not always behaving properly. The bad about this issue is that there exists no function that allows you to check if you have a valid ColdFusion date/time object or just a date/time string. A simple cfdump will also not tell you and the result looks the same. There is really no way to detect a date/time object at all! Adobe understood that this is causing serious confusion and that this is not always in our hands what we get. Now they integrated a new function that is named IsDateObject() to solve this issue. There is also a new datetime_object type for isValid().
After we identified the root cause we complained why the IsDate() / LSIsDate() / ParseDateTime() / LSIsDate() are not thowing an exception on date/time objects and simply try to do something random. We pleased them to throw an exception if an object is used as param to the functions, but Adobe and we both fear that this may break existing code. These change in behaviour is currently postponed to the next major version of ColdFusion. Based on documentation the change could be done as it works as documented than... better you check and fix the code asap.
As a strong suggestion you should always work with date/time objects and integer/float numeric values for currency values. And immediately after an URL and FORM variable comes in via CFPARAM - convert it into an object. Database wise you should always use DateTime fields and CFQUERYPARAM and never any nvarchar or similar to save date/time values. Than you will never run into such issues and can switch the site locale in whatever direction you prefer in an internationalized application. This is a very stong suggestion - never mix up your date/time and currency variables with strings and objects. Also with this new function it requires a lot of useless code just to validate the values between functions. Stay clean in your applications code - always work with objects and you convert it with formatter functions and locale on display output only.
History:
- 2016/09/20: Received the 7th version of hotfix for 4165524 that finally seems working fine. This is also available with CF2016 Updater 3 or later.
- 2016/06/17: Opened case with Adobe.