---
title: "date_trunc function in Strata | Oplema"
description: "Round a date or timestamp down to the start of a unit such as month or year. Write it as date_trunc(part, timestamp) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/date-trunc"
updated: "2026-11-04"
---

# date\_trunc

Round a date or timestamp down to the start of a unit such as month or year. Also available as datetrunc.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **TIMESTAMP**.

### Expression

```
date_trunc('month', DATE '1992-03-07')
```

### Result

```
1992-03-01 00:00:00
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 1992-03-01 00:00:00 |

## Arguments and types

```
date_trunc(part, timestamp)
```

**part**

Text

**timestamp**

Date, Interval, Timestamp

Supported signatures (4)

```
date_trunc(part: VARCHAR, timestamp: DATE) → TIMESTAMP
date_trunc(part: VARCHAR, timestamp: INTERVAL) → INTERVAL
date_trunc(part: VARCHAR, timestamp: TIMESTAMP WITH TIME ZONE) → TIMESTAMP WITH TIME ZONE
date_trunc(part: VARCHAR, timestamp: TIMESTAMP) → TIMESTAMP
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[time\_bucket

Round a date or timestamp down to the start of a fixed-width bucket, such as every 2 days. Buckets count from 2000-01-03, or from 2000-01-01 for month and year buckets, unless you pass your own origin.

](https://oplema.com/docs/strata/functions/time-bucket)[date\_part

Get one part of a date, time or interval, such as the year. Pass a list of part names to get a struct of parts.

](https://oplema.com/docs/strata/functions/date-part)[date\_add

Move a date or timestamp forward or backward by an interval.

](https://oplema.com/docs/strata/functions/date-add)[strftime

Format a date or timestamp as text using a format string such as %d/%m/%Y.

](https://oplema.com/docs/strata/functions/strftime)

[Browse dates & times](https://oplema.com/docs/strata/functions#dates-&-times) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/date.html#date_truncpart-date)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
