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

> Extract month as months from 1970-01-01 according to Iceberg partition transforms

# ICEBERG_MONTH

Extracts the month from a date or timestamp value and returns it as the number of months since 1970-01-01, according to the [Iceberg partition transforms specification](https://iceberg.apache.org/spec/#partition-transforms).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ICEBERG_MONTH(<value>)
```

## Parameters

| Parameter | Description                                            | Supported input types              |
| :-------- | :----------------------------------------------------- | :--------------------------------- |
| `<value>` | The date or timestamp value to extract the month from. | `DATE`, `TIMESTAMP`, `TIMESTAMPTZ` |

## Return type

`INTEGER`

Returns the number of months since 1970-01-01. For dates before 1970-01-01, returns a negative value.

## Remarks

The `ICEBERG_MONTH` function can be used in the `PARTITION BY` clause of [`CREATE ICEBERG TABLE`](/reference-sql/commands/data-definition/create-iceberg-table-as-select) commands.

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE ICEBERG TABLE events
  PARTITION BY (iceberg_month(event_date))
  AS SELECT * FROM source_events
WITH LOCATION = my_iceberg_location;
```

## Example

<div className="query-window">
  ```
  SELECT iceberg_month('2025-12-15'::DATE) AS month_partition;
  ```

  | month\_partition <span>int</span> |
  | :-------------------------------- |
  | 671                               |

  <p><span>Rows: 1</span><span>Execution time: 4.77ms</span></p>
</div>
