C++20 added time zone support to std::chrono
, and this includes leap seconds. However, it appears as if only leap second insertion was supported, not leap second removal, that is, negative leap seconds. (Admittedly, since 1972 there only have been positive leap seconds; but it seems that in the last few years the drift has reversed, and a negative leap second seems possible in the upcoming years.)
This is evident from the way the std::chrono::leap_second
class is described - there's no way to tell positive from negative leap seconds.
Is it known why std::chrono
doesn't support this possibility? Was this an optimization, or a mistake of some sort? Or is it supported already and I have missed something?
Note: The MSVC implementation seems to have a nonstandard feature that allows negative leap seconds.