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

> Converts Unix epoch seconds 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_seconds(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | INTEGER, BIGINT, FLOAT, DOUBLE or DECIMAL | Yes | Epoch seconds 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: seconds since Unix epoch UTC
* Output unit: UTC timestamp with microsecond precision
* Multiply by 1000000 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.
* Floating-point values are truncated toward zero after multiplication to microseconds. Non-finite floats are rejected.
* Decimal input is rounded to the nearest microsecond with halfway values away from zero.

## Examples

### Unix epoch conversion

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

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

### NULL input

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

| result |
| - |
| NULL |

## Limitations

* INTEGER, BIGINT, FLOAT, DOUBLE, and DECIMAL inputs are supported. Fractional seconds follow the rounding rules in Usage notes.
* TINYINT and SMALLINT inputs are not accepted directly. Cast them to INTEGER first.


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