> For the complete documentation index, see [llms.txt](https://docs.tabula.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabula.io/data-transformation/formulas/date-and-time-functions/datediff.md).

# DateDiff

Calculates the difference between two date \ time \ datetime based on the date or time part requested

```wolfram
DateDiff("2021-01-01 22:00:00.000", "2022-01-06 11:00:00.000", DateValueOption.QUARTER) → 4
DateDiff(column1, column2, DateValueOption.DAY) → 7
```

#### Inputs

`DateAdd(dateTime, value, datePart)`

* `dateTime` - Date, time, or datetime value
* `value` - This is the number of units of time that you want to add
* `datePart` - This indicates the units of time that you want to add, ex. DateValueOption.DAY
