Copy link to clipboard
Copied
We are running ColdFusion 2021 Enterprise on a virutal Windows 2016 platform in Azure, and our code uses the DateFormat function with the uppercase D, or DD to signify the day of the month. I injected the "-Dcoldfusion.datemask.useDasdayofmonth" parameter into the jvm.config file however it appears that it is still interpresting "DD" as day of year. Has anyone else been able get this to work correctly, and if so how did you do it?
My CFSETUP command to inject the arguments:
cfsetup.bat set jvm jvmArgs="-server --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/sun.util.cldr=ALL-UNNAMED --add-opens=java.base/sun.util.locale.provider=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED -XX:+UseParallelGC -Djdk.attach.allowAttachSelf=true -Dcoldfusion.home={application.home} -Dcoldfusion.rootDir={application.home} -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog -Djava.util.logging.config.file={application.home}/lib/logging.properties -Dtika.config=tika-config.xml -Djava.locale.providers=COMPAT,SPI -Dsun.font.layoutengine=icu -Dcom.sun.media.jai.disableMediaLib=true -Dhttps.protocols=TLSv1.2 -Dcoldfusion.enablefipscrypto=true Dcoldfusion.datemask.useDasdayofmonth -Djavax.net.ssl.trustStore={OmittingForSecurityReasons}" C:\Coldfusion\cfusion
Copy link to clipboard
Copied
Hi jmaitino,
Please try setting the flag as -Dcoldfusion.datemask.useDasdayofmonth=true and then restart the server, that should help. Please let us know if you still face this issue.
Thanks,
Datta
Copy link to clipboard
Copied
I tried that, but it did not work. I found a .zip file download called hf202100-4210921 however I don't know now to implement it in CF2021.
Previous versions I would run java.exe -jar against the .jar file, however when I unpack the .jar file out of the .zip file, it states it is an invalid .jar file.
Copy link to clipboard
Copied
You are understandably confusing an update, like comes out a few times a year, with a hotfix (something special, that Adobe only offers privately typically, in advance of a full update that would incorporate it). You're correct that for the update jar, you would either run it via the CF admin, or by running it as a jar from the command line.
But for special hotfixes like this dateformat one (which I detail here), you instead just need to drop the jar into a specific lib/updates folder within your CF instance, then restart CF for it to take effect. I have a blog post covering that also:
https://coldfusion.adobe.com/2019/11/how-to-implement-a-special-cf-hotfix/
Let us know if that gets you going.
Copy link to clipboard
Copied
@jmaitino , the flag in your jvm.config file is Dcoldfusion.datemask.useDasdayofmonth. The minus sign "-" is missing at the beginning. Change that to
-Dcoldfusion.datemask.useDasdayofmonth=true
Then save the file and restart ColdFusion.
This JVM flag is sufficient. So you won't need the JAR file.
Copy link to clipboard
Copied
BKBK, the jvm arg does no good without the jar (or update 1, when it comes out). The arg was added post-release, to solve this dateformat problem.
Copy link to clipboard
Copied
Charlie, I had looked at the documentation on DateFormat . It says:
"ColdFusion (2021 release): Added a JVM flag -Dcoldfusion.datemask.useDasdayofmonth. It defaults to false but when set to true and the mask contains D (uppercase D), the mask treats the value as d (lowercase d), day of the month."
My point is that it didn't work for Jmaitino because of the missing minus sign "-".
Copy link to clipboard
Copied
You're making two points,in fact, but I was only contending with one.
First, yes, the jar is needed. While the doc page you point to doesn't clarify it, the technote for the bug fix does, which introduced the arg and the jar. It was pointed to in the post I linked to initially, but here it is:
https://helpx.adobe.com/coldfusion/kb/dateformat-function-coldfusion-2021.html
As for the reference doc page you pointed to, it would be great if you opened a tracker ticket for that doc to be made more clear on the need of the jar, or update 1 when it comes out.
As for your second point, I wasn't debating at all with your noting previously that jmaitino had left off the dash (and left off the true, as Datta had noted). I was simply responding to your saying, they "won't need the JAR file."
As always, I'm just trying to help.
Copy link to clipboard
Copied
Ah, I see the source of the misunderstanding: that DateFormat documentation contains an error. I have followed your suggestion and created a bug ticket.
Copy link to clipboard
Copied
@jmaitino , after the discussion with Charlie, I shall modify my suggestion to: