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

# FROM_UNIXTIME

> Converts epoch seconds to a UTC timestamp or formatted string.

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

A constant NULL seconds value returns NULL. In the form without a format, NULL values in a seconds column may not remain NULL. The formatted form preserves NULL seconds values.

## Syntax

### Timestamp (scalar)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
from_unixtime(seconds)
```

### Formatted (scalar)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
from_unixtime(seconds, format)
```

## Arguments

### Timestamp

| Name | Type | Required | Description |
| - | - | - | - |
| seconds | BIGINT | Yes | Epoch seconds. Epoch seconds in \[-9223372036854,9223372036854] so seconds\*1000000 fits signed BIGINT microseconds. |

### Formatted

| Name | Type | Required | Description |
| - | - | - | - |
| seconds | BIGINT | Yes | Epoch seconds. Epoch seconds in \[-9223372036854,9223372036854] so seconds\*1000000 fits signed BIGINT microseconds. |
| format | STRING | No | Optional output format. Default: Return UTC timestamp when omitted. |

## Returns

* Type: TIMESTAMP with UTC timezone when format is omitted; STRING when format is provided
* NULL behavior: A constant NULL seconds value returns NULL. In the form without a format, NULL values in a seconds column may not remain NULL. The formatted form preserves NULL seconds values.

### Formatted

* Type: STRING
* NULL behavior: NULL scalar seconds or NULL format yields NULL.

## Properties

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

## Units

* Input unit: Epoch seconds UTC
* Output unit: UTC timestamp or formatted text
* Seconds \* 1000000 -> microseconds.

## Usage notes

* Epoch seconds multiply by 1000000 for microsecond timestamps.

## Examples

### Basic example

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

| result |
| - |
| 1970-01-01 00:00:00 UTC |

### Seconds after the epoch

This result uses UTC.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT from_unixtime(3600) AS one_hour_after_epoch;
```

| one\_hour\_after\_epoch |
| - |
| 1970-01-01 01:00:00 UTC |

## Limitations

* Query tools may report TIMESTAMP for both forms. The formatted form returns STRING and is not automatically converted to TIMESTAMP.
* In the form without a format, NULL values in a seconds column may incorrectly produce non-NULL results.
* Seconds must be within \[-9223372036854, 9223372036854]. Larger magnitudes overflow; an error or NULL result is not guaranteed.


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