4 ms·
There are `checked_add` and `checked_sub`. But that shifts the "direction" of the span to the operation, which is a static property of your program, instead of
by burntsushi 2y ago
There are `checked_add` and `checked_sub`. But that shifts the "direction" of the span to the operation, which is a static property of your program, instead of being part of the value itself, which is a dynamic property of your program. I think this results in more annoying code where you just wind up carrying a sign around anyway.
There are also negative years, even though that doesn't really correspond to anything "real" either.
Here's the thread about signed durations for Temporal: https://github.com/tc39/proposal-temporal/issues/558 https://github.com/tc39/proposal-temporal/issues/558
Apparently signed durations are a common feature in virtually every datetime library.