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

> Reference material for DATE_DIFF function

# DATE_DIFF

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

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
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

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT DATE_DIFF('day', '2024-01-01'::TIMESTAMP, '2024-04-15'::TIMESTAMP);
```

**Returns**

105
