Response to isDate() Blog Post

James Moberg - Jun 30 '20 - - Dev Community

My response to this blog post was detected as spam, so I'm responding here.

The recommendation from Adobe has been to use isValid("date") instead of isDate(). If isDate() returns TRUE, you should also test using isValid("date") and use parseDateTime (with try/catch) to see what ColdFusion actually evaluates as the date. In my opinion, a value isn't a valid date until it can be correctly parsed and then sent to third-parties and also be parsed as a date (ie, SQL).
https://tracker.adobe.com/#/view/CF-4204879

For example, tested with latest CF2016

isDate(2000); /* NO */
isValid('date',2000); /* YES */
parseDateTime(2000); /* CF Error */
Enter fullscreen mode Exit fullscreen mode

A year ago, 12/31/292278993 was considered a valid date by Adobe ColdFusion.
More info here:
https://dev.to/gamesover/coldfusion-dates-m-d-yyyyyyyyy-555h
https://tracker.adobe.com/#/view/CF-4204879
(ACF also returned TRUE for isvalid("integer", 2147483648) and a value like $45000.)

Here are some test date strings that I've used to compare ColdFusion date parsing against a client-side DateJS library that I use.
https://gist.github.com/JamoCA/acd9514b5b8cd9c3c37308aa8f48fd18

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .