Re:Ten Python datetime pitfalls, and what libraries are (not...
by zokier on Sunday February 18, 2024 @04:24PM
(#39423528)
I do point out that if your internal representation would be simple naive epoch+duration(/timedelta) then you don't need any special accounting for leap seconds when doing time arithmetic like this. The problem arises only if you are trying to be somehow clever with your internal representation (and failing).
[ Parent
| on HN ]
Re:Ten Python datetime pitfalls, and what libraries are (not...
by ariebovenberg on Tuesday February 20, 2024 @05:59AM
(#39439842)
You are correct that there are improvements to be made. The current internal representation is—for the moment—simply the Python standard library.
Probably the approach of Chrono is best: allow leap seconds to be represented (i.e. 23:59:60), but not to account for them historically.