<i18n dev> RFR: 8285844: TimeZone.getTimeZone(ZoneOffset) does not work for all ZoneOffsets and returns GMT unexpected [v3]

Naoto Sato naoto at openjdk.java.net
Wed May 11 16:40:48 UTC 2022


On Wed, 11 May 2022 09:00:45 GMT, Uwe Schindler <uschindler at openjdk.org> wrote:

>> I tried it out: If you create a ZoneId with prefixes "UT" and "UTC", they fail to convert to TimeZone. Same happens if you use this as String name in `TimeZone#getTimeZone(String)`. This is another bug / missing feature! It does not work with or without this PR.
>
> In short, we can only test what works. The test was mainly added to allow roundtrips of `ZoneOffset` instances.

The code intended to allow only offset-style ids that start with `GMT` (which is compatible with TimeZone's CustomID). Now I made changes to allow all offset-style zone ids.

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

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


More information about the i18n-dev mailing list