---
title: "date_part function in Strata | Oplema"
description: "Get one part of a date, time or interval, such as the year. For example, date_part('year', INTERVAL '14 months') returns 1."
url: "https://oplema.com/docs/strata/functions/date-part"
updated: "2026-11-04"
---

# 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.

## Try an expression

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

### Expression

```
date_part('year', INTERVAL '14 months')
```

### Result

```
1
```

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 | 1 |

## Arguments and types

```
date_part(part, value)
```

**ts**

Text, List

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

[datepart

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/datepart)[century

Get the century from a date or timestamp, such as 20 for 1992.

](https://oplema.com/docs/strata/functions/century)[day

Get the day of the month, from 1 to 31, from a date or timestamp.

](https://oplema.com/docs/strata/functions/day)[dayofmonth

Get the day of the month, from 1 to 31, from a date or timestamp.

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

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

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