> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# DateTrunc

> Truncates the date to the specified date part.

Truncates the date to the specified date part. All parts of the date smaller than the the specified part are truncated to their minimum value.

## Usage

```
DateTrunc(precision, date, [timezone])
```

**precision** (required) Smallest date part to preserve, chosen from “year”, "quarter", “month”, “week”, "week\_starting\_sunday", "week\_starting\_monday", “day”, “hour”, “minute”, and “second”. If "week" is selected, DateTrunc will have weeks start on Sunday. Parameters can be used to specify precision.

**date** (required) Date to be truncated.

**timezone** (optional) Name of <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank">IANA time zone</a> to get the date part at, e.g.”America/Los\_Angeles”. When calculating a time zone, input dates are treated as UTC.

## Notes

* Sigma presents the output in the organization's time zone. This might cause days, months, or years to appear offset if the specified time zone is ahead of the organization time zone. To view the output presented in the specified time zone, you can apply [ConvertTimezone](/docs/converttimezone). For more information, see [Account time zone](/docs/account-time-zone).
* The **precision** argument does not support columns.

## Example

```
DateTrunc("hour", Date("1980-05-22 8:45:30"))
```

* Returns `1980-05-22 8:00:00`, discarding the “minute” and”second” components of the date.

```
DateTrunc("day", Date("1980-05-22 8:45:30"))
```

* Returns `1980-05-22 00:00:00`, discarding the time components of the date.

```
DateTrunc("month", [Order Date])
```

* Returns the first day of the month for each date in the *Order Date* column.

## Related resources

* <a href="https://quickstarts.sigmacomputing.com/guide/common_date_functions/" target="_blank" rel="noopener noreferrer">
    Quickstart: Common date functions and use cases
  </a>