> 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/datetrunc.md).

# DateTrunc

Truncates (rounds) a datetime to the specified precision

```mathematica
DateTrunc("2022-01-19 20:00:00", DateValueOption.MONTH) → 2022-01-01 00:00:00
DateTrunc("2022-10-28 20:00:00.000", DateValueOption.YEAR) → 2022-01-01 00:00:00.000
```

#### Inputs

`DateTrunc(dateTime, datePart)`

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