Skip to main content
Inspiring
Mar 10, 2021 11:17 AM UTC
Question

CF2021 and DateFormat

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 is closed to new replies. Start a new post to keep the conversation going.

    9 replies

    dattanandb56935331
    Participating Frequently
    Mar 10, 2021 3:12 PM UTC

    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

    Translate
    jmaitinoAuthor
    Inspiring
    Mar 10, 2021 4:19 PM UTC

    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.

     

    Translate
    Charlie Arehart
    Community Expert
    Community Expert
    Mar 11, 2021 3:30 PM UTC

    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.

    Translate
    /Charlie (troubleshooter, carehart. org)