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

# DATE_DIFF

> Reference material for DATE_DIFF function

Calculates the difference between `start_timestamp` and `end_timestamp` by the indicated unit.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
DATE_DIFF('<unit>', <start_timestamp>, <end_timestamp>)
```

## Parameters

| Parameter | Description |
| :- | :- |
| `<unit>` | A TEXT literal specifying the time unit. Must be one of `microsecond`, `millisecond`, `second`, `minute`, `hour`, `day`, `week`, `month`, `quarter`, `year`, `decade`, `century`, or `millennium`. |
| `<start_timestamp>` | A value expression evaluating to a `TIMESTAMP` or `TIMESTAMPTZ` value. |
| `<end_timestamp>` | A value expression evaluating to a `TIMESTAMP` or `TIMESTAMPTZ` value. |

## Return Type

`BIGINT`

## Example

```
SELECT DATE_DIFF('day', '2024-01-01'::TIMESTAMP, '2024-04-15'::TIMESTAMP);
```

| date\_diff long |
| :- |
| 105 |

Rows: 1Execution time: 4.46ms


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.