Overview
| Artifact ID: | dd8ece7a0a7040887aa58c91841d37421225d9749acfc5aa8a074ab3fab41a96 |
|---|---|
| Ticket: | f2b5f89c0d8520ea86b929daa19ec13fc3a24d2d
clock scan of leapsecond: wrong result in 8.6 and 9.0 |
| User & Date: | sebres on 2024-11-15 11:23:10 |
Changes
- icomment:
The problem is we cannot resolve that - what you constantly forget is that [clock scan] converts string input to unix time, which in turn simply doesn't know a leap second at all. It was solved in a pragmatic way by programmers and a leap second is simply a time adjustment or else a short time drift (one second in year lasts longer or switches later). Neither it can be represented somehow, nor it is expected to be converted from input, in no one language on earth. Moreover it'd be mathematically wrong (and yes clock scan and clock format are reverse functions in this regard)... So lets also follow this pragmatically. The comparison with 140km/h doesn't match too, because it represents not only the speed, but also the distance one would reach with that speed, what is a mathematically correct representation in any direction. Leap second is not such thing, at least in current state of the art, how it is implemented in target systems (OS) for Tcl. Regarding ISO 8601: well, 0 is also available number in math, but you'd not expect that Tcl will start to support division by zero. And the fundamental question, IMHO, is how you'd represent this leap second in a unit of measure that never has this ability - unix time always reflects 60 seconds per minute, 3600 per hour, 86400 per day. Unexceptionally. It knows leap day (in a leap years), but not an extra second. Regarding the migration notes (you mentioned somewhere), one doesn't even need to mention it in, because it never worked correctly before (so very probably never used). But perhaps it is something for the documentation. However migration notes shall contain the switch of validation mode, so this is fully enough in my opinion. In case of possible future improvement, the things can surely change, but then clock facilities need to consider different "base" value than seconds since epoch, e. g. something like a new clock-object containing integer or tuple representation, which can consider leap second fully and value goes "incremented" by leap second. Something like new option, e.g. `-ut 1` or whatever, that would expect different base format for [clock add] and [clock format] as well as different return value by [clock scan]. However, how many documentations say, such feature is questionable... Here is PostgreSQLs point of view, for example: <i>There's been very little user demand for leap-second-aware date arithmetic, and the difficulties with extrapolating such arithmetic into the future mean that we're not likely ever to try to support it.</i>
- login: "sebres"
- mimetype: "text/x-markdown"