Non-calendar durations unambiguously represent a fixed amount of time. Internally, this
and other
are both converted to nanoseconds (assuming 24-hour days) and added together. The result is then converted back to a Temporal.Duration
object, so the result is always balanced with the largest possible unit being days
.
If you want to perform addition or subtraction with a calendar duration, you can add both durations to a starting point and then figure out the difference between the two resulting instants; that is, dur1 + dur2
is equivalent to (start + dur1 + dur2) - start
.
To add a duration to a date or time, use the add()
method of the date or time object instead.