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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/iceberg/partitioning/iceberg_hour",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Extract hour as hours from 1970-01-01 00:00:00 according to Iceberg partition transforms

# ICEBERG_HOUR

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

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ICEBERG_HOUR(<value>)
```

## Parameters

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

## Return type

`INTEGER`

Returns the number of hours since 1970-01-01 00:00:00 UTC. For timestamps before this epoch, returns a negative value.

## Remarks

The `ICEBERG_HOUR` 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":"github-light","dark":"github-dark"}}
CREATE ICEBERG TABLE events
  PARTITION BY (iceberg_hour(event_timestamp))
  AS SELECT * FROM source_events
WITH LOCATION = my_iceberg_location;
```

## Example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT iceberg_hour('2025-12-15 14:30:00'::TIMESTAMP) AS hour_partition;
```

**Returns:**

| hour\_partition |
| :-------------- |
| 490502          |
