Skip to main content
Inspiring
March 10, 2021
Question

CF2021 and DateFormat

  • March 10, 2021
  • 1 reply
  • 658 views

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

 

 

    This topic has been closed for replies.

    1 reply

    dattanandb56935331
    Participating Frequently
    March 10, 2021

    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

    jmaitinoAuthor
    Inspiring
    March 10, 2021

    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.

     

    Charlie Arehart
    Community Expert
    Community Expert
    March 11, 2021

    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.

    /Charlie (troubleshooter, carehart. org)