# Operators with Dates and Times

## Content

You can use several of the operators with dates and times as summarized here:

| Operator | Type of Operation | Result |
| -------- | ----------------- | ------ |
| Plus | + TimeSpan | TimeSpan |
| Negate | \- TimeSpan | TimeSpan |
| Add | DateTime + TimeSpan | DateTime |
| Add | TimeSpan + DateTime | DateTime |
| Add | TimeSpan + TimeSpan | TimeSpan |
| Subtract | DateTime - DateTime | TimeSpan |
| Subtract | DateTime - TimeSpan | DateTime |
| Subtract | TimeSpan - TimeSpan | DateTime |

The same order of precedence applies, including the use of parentheses, as described in [Order of Precedence](/spreadjs/docs/v16/formulareference/formulaoverview/operatorsinaformula/orderofprecedence).

If a DateTime or TimeSpan calculation results in an exception (for example, an `OverflowException`), the operator returns the #NUM! error.