# Using Operators with Dates and Times

Spread for WinForms provides advanced software components that support Excel import/export, full cell customization, an extensive calculation engine with over 450 functions and more, all with zero dependencies on Excel.

## 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 use of parentheses, as described in [Order of Precedence](/spreadnet/docs/latest/online-formula/formulas-overview/formulas-operators/formulas-orderprecedence). For more information about functions that use and return DateTime and TimeSpan objects, refer to [Date and Time Functions](/spreadnet/docs/latest/online-formula/formulas-overview/formulas-functs/formulas-functtypes/formulas-functsdatetime).
If a DateTime or TimeSpan calculation results in an exception (for example, an OverflowException), the operator returns the #NUM! error.