4 ms·
That would most be a local problem and would not continue to exist for a long period of time. tzdata is complex, but having waded through it a few times, it
by akira2501 4y ago
That would most be a local problem and would not continue to exist for a long period of time.
tzdata is complex, but having waded through it a few times, it seems needlessly so for the desired use cases. There is more editorial comments than data in the files, and they spend a lot of time and effort creating entries for historical time zones so that you can convert times in the year 1942 into territorial time zones that don't even exist any more with perfect accuracy.
Except, even then, it seems like it's not. If you dig into the time routines that use tzdata, you see they must use an unstable conversion process that _may_ converge, but has a simple counter protecting it in the case that it _does not_ converge and in that case it just gives you a best guess time that may still be wrong anyways.
Really.. the problem I have and I suspect is the majority of cases, I have a time in Some/Zone and I want to tell someone in Another/Zone what the time would be on their clock, today, right now. The time our grandfathers would have used during the War in summer is never going to be material to me in this instance or for the majority of use cases.
This isn't meant to be overly critical of tzdata just a recent annoyance I experienced when trying to find a minimal code and cross language solution to the above problem.
- nightpool 4y ago> If you dig into the time routines that use tzdata, you see they must use an unstable conversion process that _may_ converge, but has a simple counter protecting it in the case that it _does not_ converge and in that case it just gives you a best guess time that may still be wrong anyways. What does this mean? Can you explain in a little more detail, or link to somewhere I might read about this? I haven't used tzdata myself, but I understand it in broad strokes as a list of time zones, and a list of which offsets apply to which timezones at which given dates. What am I missing?
- akira2501 4y agoSee the code for __mktime_internal in glibc, specifically the case for which it returns EOVERFLOW; but in general, the whole file has many comments worth reading. https://code.woboq.org/userspace/glibc/time/mktime.c.html https://code.woboq.org/userspace/glibc/time/mktime.c.html
- Dylan16807 4y agoExtra historical zones and comments don't add any real complexity, do they? > If you dig into the time routines that use tzdata, you see they must use an unstable conversion process that _may_ converge, but has a simple counter protecting it in the case that it _does not_ converge and in that case it just gives you a best guess time that may still be wrong anyways. What kind of time zone data would be required to make it fail to converge when that time actually did exist?