> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# time_for_duration

> Filters time fields for a specific duration starting from a given point in time.

Filters time fields for a specific duration starting from a given point in time. This filter is useful for filtering over various time periods using either relative time (e.g., `"28 days ago"`) or fixed dates (e.g., `"2024-06-01"`).

## Syntax

```yaml theme={null}
<time_field>:
  time_for_duration: [ <start_time>, <duration> ]
```

## Properties

<ParamField path="time_field" type="string" required>
  The time or date field to filter on, specified in the format `view_name.field_name`.
</ParamField>

<ParamField path="time_for_duration" type="string[]" required>
  An array with two elements: `[starting_time, unit_of_time_length]`.

  * `start_time` - The starting time for the duration. Can be:

    * **Relative time:** `28 days ago`, `7 complete weeks ago`
    * **Fixed date:** `2024-06-01`

  * `duration` - The length of time after the starting point. For example, `30 days`, `1 year`, `7 days`
</ParamField>

## Examples

```yaml title="From June 1 - 30, 2024" theme={null}
orders.created_date:
  time_for_duration: [ 2024-06-01, 30 days ]
```

```yaml title="Any time in 2024 except June 1 - 30" theme={null}
orders.created_date:
  not_time_for_duration: [ 2024-06-01, 30 days ]
```
