Skip to main content
elisabethf82215657
Inspiring
December 15, 2022
Question

jvm timezone vs server time and flex applications

  • December 15, 2022
  • 1 reply
  • 1206 views

My team develops and maintains a Coldfusion application (using CF 2018 Update 15) including multiple occasionally connected clients using the flex gateway for data exchange.

Currently our application is being migrated to new server infrastructure and on the new servers we need help with a problem.

 

On the old servers we had the following JVM timezone configuration: -Duser.timezone=NewYork

This had to be added because without this timezone parameter some objects could not be synchronized between the flex clients and the server.

 

All of our servers are in timezone CET, but on the old servers everything worked well. The time used in the Coldfusion application was server time (CET).

 

On the new servers with the same JVM configuration the server time again is CET, but Coldfusion now internally uses timezone NewYork. When we configure CET in the JVM everything is ok in the Web application, but again the Flex clients fail to synchronize.

 

The only difference I can see between the two installations is the used Java version:

On the old servers we use Java 11.0.15.1, on the new ones 11.0.16.

 

Can the different behaivour come from the difference in the Java version? Or is there a hidden configuration somewhere to make Coldfusion ignore the JVM timezone?

 

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    December 15, 2022

    Before we look further, let's get one thing out of the way first.

     

    Replace 

    -Duser.timezone=NewYork

    with

    -Duser.timezone=America/New_York

     

    Then restart ColdFusion. See if that helps.

    elisabethf82215657
    Inspiring
    December 15, 2022

    Thank you for your response!
    I know that NewYork is not a legal timzone string. This is where we got the workaround from in the first case:
    https://stackoverflow.com/questions/54674629/coldfusion-2018-and-blazeds-datetime-parse-error-for-three-char-daylight-saving

     

    I changed the JVM timezone to Americy/New_York and again had the problem of the wrong server timezone:

     

    We need to have CET time and zone.

    BKBK
    Community Expert
    December 16, 2022

    This is exactly what we do at the moment. We work on the synchronization problem and use the timezone CET on the new, not yet productive, server.

     

    But my question here is: Why do I have 2 coldfusion servers with the same CF version and the same JVM timezone setting (NewYork) and on one of the servers the function now() supplies server time, on the other server it supplies NewYork local time? Is there some configuration setting we have missed?


    quote

    But my question here is: Why do I have 2 coldfusion servers with the same CF version and the same JVM timezone setting (NewYork) and on one of the servers the function now() supplies server time, on the other server it supplies NewYork local time? Is there some configuration setting we have missed?


    By @elisabethf82215657

     

    I think I have already answered the question. 🙂

    Perhaps not clearly. So here is my answer once again.

     

    The setting 

     

    -Duser.timezone=NewYork

     

    is probably incorrect. If you use it, ColdFusion will ignore it and use the server's timezone instead.

     

    If you use the correct setting, namely,

     

    -Duser.timezone=America/New_York

     

    then the value of ColdFusion's now() will be the current time in New York. 

     

    That is the behaviour I would expect in any case. As far as I can see there was no change in Java timezone behaviour between Java 11.0.15 and Java 11.0.16.