---
title: "month function in Strata | Oplema"
description: "Get the month number, from 1 to 12, from a date or timestamp. For example, month(DATE '1992-02-15') returns 2. Works in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/month"
updated: "2026-11-04"
---

# month

Get the month number, from 1 to 12, from a date or timestamp.

## Try an expression

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

### Expression

```
month(DATE '1992-02-15')
```

### Result

```
2
```

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

## Arguments and types

```
month(ts)
```

**ts**

Date, Interval, Timestamp

Supported signatures (4)

```
month(ts: DATE) → BIGINT
month(ts: INTERVAL) → BIGINT
month(ts: TIMESTAMP WITH TIME ZONE) → BIGINT
month(ts: TIMESTAMP) → BIGINT
```

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

[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)[dayofweek

Get the day of the week as a number, where Sunday is 0 and Saturday is 6.

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

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

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