Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello All,
Last weekend Brazil should have entered Daylight Savings Time but it was canceled earlier this year by the government. After that, some services that use times are very strange.
For instance, this simple javascript code that returns the epoch timestamp:
time = new Date ("2019","09","25","0","0","0");
time_ms = time.valueOf();
result = time_ms;
This returns the following result: 1571968800000.
Converting this epoch value to date time using https://www.epochconverter.com/ gives the following date-time:
Thursday, October 24, 2019, 11:00:00 PM GMT-03:00 which is offset in 1 hour from the time inserted originally.
Using the same code on an online javascript editor such as https://playcode.io/ gives the result 1571972400000 which gives the correct date.
The time on the client-side and the server-side are correct.
Any thoughts?
Solved! Go to Solution.
ThingWorx has a number of libraries and dependencies that embed their own timezone database. These timezone DBs can be out of date causing the issues with BRT time you outlined above. The BRT changes are included the the IANA 2019b and above timezone DBs: https://www.iana.org/time-zones
The upcoming patches for ThingWorx will attempt to update the third-party timezone libraries, but in the meantime the following two fixes are needed for your environment:
1. Update the JRE timezone database:
2. Update the Joda-time library deployed with ThingWorx:
Step #2 may need to be repeated if the ThingWorx.war file is re-deployed (i.e. you upgrade to a patch version that does not have the latest joda-time library, for example upgrading from 8.4.1 to 8.4.5 would require you to re-patch the joda-time jar file).
Please let me know if this addresses the issue or if you continue to see problems.
ThingWorx has a number of libraries and dependencies that embed their own timezone database. These timezone DBs can be out of date causing the issues with BRT time you outlined above. The BRT changes are included the the IANA 2019b and above timezone DBs: https://www.iana.org/time-zones
The upcoming patches for ThingWorx will attempt to update the third-party timezone libraries, but in the meantime the following two fixes are needed for your environment:
1. Update the JRE timezone database:
2. Update the Joda-time library deployed with ThingWorx:
Step #2 may need to be repeated if the ThingWorx.war file is re-deployed (i.e. you upgrade to a patch version that does not have the latest joda-time library, for example upgrading from 8.4.1 to 8.4.5 would require you to re-patch the joda-time jar file).
Please let me know if this addresses the issue or if you continue to see problems.
Hello @GBeltramini ,
JavaScript code that you write in ThingWorx services is compiled to Java bytecode and executed on JVM. The latter has its own timzone database, which is as old as the JDK you are using. Just random ideas (might be complete nonesense):
/ Constantine
Hi @GBeltramini.
If one of the previous responses allowed you to resolve your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.
Regards.
--Sharon