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

# week

Get the ISO week number 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

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

### Result

```
7
```

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

## Arguments and types

```
week(ts)
```

**ts**

Date, Interval, Timestamp

Supported signatures (4)

```
week(ts: DATE) → BIGINT
week(ts: INTERVAL) → BIGINT
week(ts: TIMESTAMP WITH TIME ZONE) → BIGINT
week(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#weekdate)

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