0

I'm having an issue with the Primeface's 6.0 calendar component: normally here in Brazil we apply DST adding 1h to or clocks in the month of October. Exceptionally this year the rule was different with the addition occuring only last November 4th. As you may confirm in Brazilian news pages, this caused many confusion with apps, many of which added the 1 hour days before the correct Nov 4th. One of this wrong dates was October 21.

This caused an issue with a web app I'm developing. It shows info taken from a database which is filled with data coming from many industry equipments. At Oct 21 00:00 till 01:00, these equipments correctly continued to send their data to the database which in turn filled the correct table with these time stamps. The problem occurs when, inside the webpage, one asks to view data from Oct 21 00:00 - 01:00: the calendar component wrongly returns this is an invalid date time value, clearly a manifestation of the DST situation whe had here in Brazil.

So the proper solution here would be to "teach" calendar the datetime between 00:00 till 01:00 of Oct 21 is actually valid date time and my question is how to do this. I red in websites this component is supposed to be filled with time zones informations retrieved from the local server/machine, but looking at the clock of the Windows Server the page is in, it correctly tells the DST +1h change was in Nov 4th. I also looked at java.util.TimeZone's Oracle Docs and couldn't find anything mentioning creating customized info about DST.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Momergil
  • 2,213
  • 5
  • 29
  • 59

1 Answers1

1

Oracle publishes time zone updates for Java via the TZUpdater utility, and also by updates to the JRE itself.

The Brazil change you mentioned was published with tzdata 2018c. From the chart linked above, that was released with JRE versions 10, 8u172, 7u181, and 6u191. You can simply update your JRE to one of those versions or newer, and you will have the correct time zone data. OR, you can run TZUpdater and keep your JRE on whatever version it is at.

Another option is to use ZIUpdater from Azul Systems, which works on both Oracle JRE, and OpenJDK, as well as other Java implementations.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575