Date and time types support the addition or subtraction of various durations. Note that this operation produces a result of the same type as the operand before the operator:
Of course, durations can be added and subtracted from each other:
When different kinds of durations are mixed the result is a relative_duration
:
Finally, it's possible to subtract one datetime
value
from another to get a duration
:
When calculating the difference between two local_datetime
or local_time
values the result is a relative_duration
:
When subtracting one local_date
from another the result is
a date_duration
: