Re: [Datetime-SIG] IANA TZ database statistics
![](https://secure.gravatar.com/avatar/7c721b6de34c82ce39324dae5214dbf8.jpg?s=120&d=mm&r=g)
https://github.com/abalkin/cpython/commit/54d3596b0180512c68c91e8308665c0a9e...
[Tim]
Wondering whether this line:
if probe2 != result + trans:
could be replaced with:
if probe2 == result:
[Alex]
Yes, it can. Thanks for the suggestion.
Good! So you have a simple, cross-platform solution now, at least for timestamps localtime() doesn't barf on.
The only assumption that it requires is that no fold is bigger than 24 hours.
Well, it does rely on more than just that. For example, if there's a gap where the clock jumps from 2 to 3, followed soon after by a fold of an hour repeating times of the form 4:MM, then the second occurrence of 4:30 won't be detected as such.- the fold and the gap "cancel out" with respect to subtracting 24 hours in either naive time or timestamp time. So it seems a sufficient condition is that there's at most one UTC offset change in the last 24 hours. I wouldn't be surprised if that's always true now - or that it won't be after Kim Jong-un learns he could annoy us by making it false ;-)
participants (1)
-
Tim Peters