Overview
| Artifact ID: | 8ecefd73a484b0d5e8dade7683e15e3ef6f85f9c07b462809a732481ccdedfd4 |
|---|---|
| Ticket: | f2b5f89c0d8520ea86b929daa19ec13fc3a24d2d
clock scan of leapsecond: wrong result in 8.6 and 9.0 |
| User & Date: | sebres on 2024-11-21 22:09:29 |
Changes
- icomment:
This was my first assumption too, but it was based on: * the complexity (or rather the relation between the complexity and needs of such scan) * the effort to implement it properly, as it were, to comply the ISO 8601 and OS behaviour (freeze the second) at the same time; * the common sense on top (leap seconds is not really representable in result of scan, at least as long as it remains unix-time) and the fact that it has been implemented quasi nowhere. However, I think I managed it in-between, here is the branch that shall satisfy all of them: [./vdiff?from=13d4d3d6f26d2ffa&to=bug-f2b5f89c0d-alt-leapsec|bug-f2b5f89c0d-alt-leapsec]. The pros: * leap second detected more precise, because estimated from UTC tokens or/and complying real leap-second table of iana; * leap second remains in the same calendar day as previous second; * almost no performance loss (excepting the single load of leap-sec table once per process); not affected at all for all times excepting Thh:mm:60; and it uses very optimal algorithm (interpolation binary search, IBS), which checks whether the second is leap or not, in optimal case with single, mostly with 2, maximally with 3 iterations in the table, so it is almost to neglect; * besides the scan result of leap second covers ISO 8601 standard more sane and it is also more similar to OS behaviour (long, frozen second Thh:mm:59), it also matches better to the input string (e. g. all tokens excepting the second remain the same - calendar year, month, week of year, day, weekday, hour and minute are the same as specified in input or are in accordance with the timestamp of leap second); * with the table it'd be able to capture every leap second (after update with tclZIC from iana database), even if it will not follow the current rules, e. g. belong to different dates than "31 Dec" or "30 Jun"; * apart from the table, it can also estimate the leap second ("31 Dec" or "30 Jun", "T23:59:60 UTC"), what will detect possible future leap second without an update (of "tzdata/.leapsec"); * on demand, it is possible to disable estimation of leap second, so it'd only inspect the leap table. The cons: * unknown, excepting the deviation to 8.6 (but before the fix [595fad24d70e1693] it never worked properly, so it does no matter, in my opinion); * a bit grown code base. - login: "sebres"
- mimetype: "text/x-fossil-wiki"