<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 23, 2015 at 6:16 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1n1" class="a3s" style="overflow:hidden">A lot of the small numbers are going to be when different places<br>
adopted standard time, and such. To get a better handle on what's<br>
happening _now_, I added an option [1] to your stats function for a<br>
starting year:<br>
<br><font face="monospace, monospace" size="1">
>>> ZoneInfo.stats(start_year=1970)<br>
Number of zones:  1790 = 46266 (gaps) + 46130 (folds) + 843 (zeros)<br>
Min gap:                  0:15:00 at 1985-12-31 18:30:13 in right/Asia/Kathmandu<br>
Max gap:           1 day, 0:00:00 at 2011-12-30 10:00:24 in right/Pacific/Apia<br>
Mi<span class="aBn" tabindex="0"><span class="aQJ">n fold:</span></span>                 0:30:00 at 2037-04-04 15:00:26 in right/Australia/Lord_Howe<br>
Max fold:                 3:00:00 at 2012-02-21 17:00:24 in right/Antarctica/Casey<br>
>>> ZoneInfo.stats()<br>
Number of zones:  1790 = 58914 (gaps) + 58777 (folds) + 1363 (zeros)<br>
<span class="">Min gap:                  0:00:16 at 1935-01-01 03:40:52 in </span>posix/America/Paramaribo<br>
Max gap:           1 day, 0:00:00 at 2011-12-30 10:00:24 in right/Pacific/Apia<br>
<span class="">Min fold:                 0:01:31 at 1932-01-01 03:58:29 in </span>posix/America/Barbados<br>
<span class="">M<span class="aBn" tabindex="0"><span class="aQJ">ax fold</span></span>:                10:00:00 at 1952-01-13 14:00:00 in </span>posix/Antarctica/DumontDUrville</font></div></blockquote><div><br></div><div>It looks like you've got double counts because you included both "posix" and "right" tzfiles in the search.  (I don't think the data that I actually read is different between the two sets.) </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1n1" class="a3s" style="overflow:hidden"><br>
I'm not sure whether this actually helps anything or not, but hey, cool stats :)</div></blockquote></div><br>If we can make some simplified assumptions about transition locations and sizes, we can avoid a binary search over seconds to locate the transitions via POSIX localtime/mktime APIs.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I am considering making the cut-off at 1970 and assume 1970 standard time for all times before that year.  I think this is best we can do on Windows where (IIRC) mktime does not work for times before epoch.  (What about localtime?)</div><div class="gmail_extra"><br></div><div class="gmail_extra">In any case, TZ data before 1970 is highly suspect so we will probably do our users a favor by assuming standard time and letting those with historical timeseries figure out the transitions by themselves.</div></div>