Charlie Arehart

Wow. Beware of this subtle breaking change in CF2021, something discovered since its release (was not documented as one of the “new” things, nor was it documented at all in the beta).

TLDR; a simple demo of the problem

Consider this fragment, which could exist in similar form in millions of CFML templates: dateformat(“11-24-20″,”MM-DD-YY”)

See anything wrong? Probably not. It will indeed “work fine” in CF2018 and before, producing 11-24-2020, as most would expect.

But that same code in CF2021 will produces instead 11-329-2020, which virtually no one would expect! Because D now means “day in year”. It’s a Java-standard datemask, but until now CF didn’t complain if you used D. It treated it like d.

Read the whole article here.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.