Formula Overview > Operators in a Formula > Using Operators with Dates and Times |
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 use of parentheses, as described in Order of Precedence. For more information about functions that use and return DateTime and TimeSpan objects, refer to Date and Time Functions.
If a DateTime or TimeSpan calculation results in an exception (for example, an OverflowException), the operator returns the #NUM! error.
Return to Operators in a Formula.
Return to the Formula Overview.