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

# TIMESTAMP_MILLIS

> Converts Unix epoch milliseconds to a UTC timestamp.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL for NULL input. Non-finite numeric values or arithmetic overflow raise an error.

## Syntax

### Scalar

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

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | INTEGER or BIGINT | Yes | Epoch milliseconds since 1970-01-01 00:00:00 UTC. |

## Returns

* Type: TIMESTAMP with UTC timezone
* Possible values: UTC instants representable as signed 64-bit microseconds.
* NULL behavior: Returns NULL for NULL input. Non-finite numeric values or arithmetic overflow raise an error.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Exact result | Yes |

## Units

* Input unit: milliseconds since Unix epoch UTC
* Output unit: UTC timestamp with microsecond precision
* Multiply by 1000 to obtain microseconds.

## Usage notes

* Negative inputs represent instants before the Unix epoch.
* Conversion results must fit a signed 64-bit count of microseconds; overflow raises an error.

## Examples

### Unix epoch conversion

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT timestamp_millis(1704067200000) AS result;
```

| result |
| - |
| 2024-01-01 00:00:00 UTC |

### NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT timestamp_millis(CAST(NULL AS BIGINT)) AS result;
```

| result |
| - |
| NULL |

## Limitations

* TIMESTAMP\_MILLIS and TIMESTAMP\_MICROS require integer inputs. FLOAT, DOUBLE, and DECIMAL inputs are not supported.
* Use INTEGER or BIGINT. Cast TINYINT and SMALLINT values to INTEGER before calling the function.


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