On Jan 23, 2018, at 10:42 AM, Stephen Colebourne <scolebourne@joda.org> wrote:
There is no possible fix to Java, as this is primarily an issue between CLDR and TZDB. The two have a subtle API linkage which has perhaps never been clearly spelled out here.
Perhaps the contract between the tzdb and its users needs to be made more detailed here, with the tzdb explicitly saying what it guarantees and what it doesn't guarantee; the tzdb doesn't change what it guarantees; no users ever depend on what it doesn't guarantee; and with some stuff that the tzdb currently doesn't guarantee perhaps becoming guaranteed because there are clients that can't just stop depending on it.
CLDR provides textual names for time-zones, as an array [winter, summer]. As a much larger project with considerable history the order of that array is not going to change. (I'm using winter and summer for CLDR for this email to aid clarity, they refer to them as standard and daylight).
TZDB provides the offsets, SAVE values and a short text string. This text string - GMT/IST or IST/GMT - is not directly linkable to the data CLDR provides. Although it may seem that you can use the text from TZDB as a key to lookup the correct value in CLDR, I know from painful experience that approach fails (as the TZDB text varies over time, has the same text in winter and summer, or isn't even text). Thus, the only reliable way to pick which piece of CLDR data is needed is from the offsets.
For 20 years, this has been done in a simple and straightforward way - if (raw-offset != actual-offset) then CLDR uses summer text and array element 1. This provides the necessary glue to link the two projects:
boolean inSummerTime(instant) { return getRawOffset(instant) != getActualOffset(instant) } zoneName = inSummerTime(instant) ? cldr-summer-time-text : cldr-winter-time-text
OK, so "instant" isn't passed to localtime() or localtime_r(), or to code in CLDR that does the same thing that those functions do, to get tm_isdst or the equivalent information? How does CLDR determine those offsets?