Description
So ClientProperties.getTimeZone() got UTC offset 11 and DST offset 10 (Australia Sydney), and it picked the wrong one (UTC +11). The issue is the way it's calculating the UTC-DST difference and looking up in the available time zone IDs.
if (dstTimeZone != null && dstTimeZone.getRawOffset() != timeZone.getRawOffset()) { int dstSaving = dstTimeZone.getRawOffset() - timeZone.getRawOffset(); String[] availableIDs = TimeZone.getAvailableIDs(timeZone.getRawOffset()); for (String availableID : availableIDs) { TimeZone zone = TimeZone.getTimeZone(availableID); if (zone.getDSTSavings() == dstSaving) { // this is a best guess... still the start and end of the DST should // be needed to know to be completely correct, or better yet // not just the GMT offset but the TimeZone ID should be transfered // from the browser. timeZone = zone; break; } } }
If dstTimeZone.getRawOffset() < timeZone.getRawOffset() then dstSaving is negative and it would never find any zone in the availableIDs.
I'm sending a PR for this.
Attachments
Issue Links
- links to