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

Gaurav Chaudhari duke at openjdk.org
Thu Jul 28 19:43:04 UTC 2022


> This is a REDO of the Fix that was incompletely implemented earlier:
> [8285838: Fix for TZ environment variable DST rules](https://github.com/openjdk/jdk/pull/8660)
> 
> Offset calculation now accounts all the way upto year in order to avoid cross-day miscalculations as well as to calculate always in the correct direction for offset. In situations where there may be multiple days, the excess days of offset will be shaved off by applying mod to `seconds_per_day` , which will remove the excessive days that might be included in the offset calculation for special scenarios like a leap year / February months and variances between 30 and 31 days.
> 
> I have tested this solution with the cases where this fix had failed last time as well, and confirmed it works:
> _(where 7200 represents 7200 seconds -> +2 hour offset)_
> Sample output:
> ![image](https://user-images.githubusercontent.com/6877595/176259828-07e27901-4a3f-4949-bd8d-2f88c979685a.png)

Gaurav Chaudhari has updated the pull request incrementally with one additional commit since the last revision:

  8288377: Adjusted length check for returned gmt-offset

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/9312/files
  - new: https://git.openjdk.org/jdk/pull/9312/files/8ca0a727..b09df3d5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9312&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9312&range=02-03

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/9312.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9312/head:pull/9312

PR: https://git.openjdk.org/jdk/pull/9312


More information about the i18n-dev mailing list