<i18n dev> RFR: 8285838: DST not applying properly with zone id offset set with TZ env variable [v6]

Naoto Sato naoto at openjdk.java.net
Thu Jun 2 18:09:43 UTC 2022

On Wed, 1 Jun 2022 13:32:36 GMT, Gaurav Chaudhari <duke at openjdk.java.net> wrote:

>> This fix ensures that when a lookup for a custom TZ code fails, and an attempt is made to find the GMT offset in order to get the current time, Daylight savings rules are applied correctly.
> Gaurav Chaudhari has updated the pull request incrementally with two additional commits since the last revision:
>  - 8285838: Cleanup of trailing whitespace
>  - 8285838: Corrected month comparison check for TZ DST

I tried several runs of CI tests and found no failures. Sorry for the false alarm. BTW, now I've looked the test more closely, the test can be simplified by using `SimpleTimeZone`, such as:

 new SimpleTimeZone(3600000, "MEZ-1MESZ", Calendar.MARCH, -1, Calendar.SUNDAY, 0, Calendar.OCTOBER, -1, Calendar.SUNDAY, 0).inDaylightTime(new Date())

This piece will check the current date is in DST, emulating `TZ=MEZ-1MESZ,M3.5.0,M10.5.0`


PR: https://git.openjdk.java.net/jdk/pull/8661

More information about the i18n-dev mailing list