# timestamp_millis

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: timestamp_millis
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/timestamp-functions/timestamp-millis
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/timestamp-functions/timestamp-millis.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/timestamp-functions/timestamp-millis.adoc
description: The `timestamp_millis()` function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/timestamp-functions/timestamp-millis.md -->

The `timestamp_millis()` function converts a given UNIX timestamp value in milliseconds since 1970-01-01 00:00:00 UTC into a timestamp. Its syntax is:

```sql
SELECT TIMESTAMP_MILLIS(BIGINT)
```

Its input type is a `bigint` expression which represents a UNIX timestamp in milliseconds and the return data type is a timestamp.

## [](#examples)Examples

### [](#basic-timestamp_millis-function)Basic `timestamp_millis()` function

This example shows how to use the `timestamp_millis()` function to convert a given UNIX timestamp in milliseconds into a timestamp without a timezone.

```sql
SELECT TIMESTAMP_MILLIS(1671975000000) AS timestamp_millisvalues;
```

The query returns:

```sql
+-----------------------------+
| timestamp_millisvalues      |
+-----------------------------+
| 2022-12-25 13:30:00         |
+-----------------------------+
```

### [](#timestamp_millis-function-using-columns)`timestamp_millis()` function using columns

Suppose a table named **unix\_example** has these UNIX time values in milliseconds in the **unix\_timestamp** column:

```sql
CREATE TABLE unix_example (
  unix_timestamp long
);

INSERT INTO unix_example VALUES
('171472000000'),
('1671975000000'),
('153276000000');
```

```sql
SELECT * FROM unix_example;
```

This query shows the table:

```sql
+----------------+
| unix_timestamp |
+----------------+
| 171472000000   |
| 1671975000000  |
| 153276000000   |
+----------------+
```

To convert all UNIX timestamp values in milliseconds to timestamp values, run the query:

```sql
SELECT unix_timestamp, TIMESTAMP_MILLIS(unix_timestamp)
AS timestamp_value
FROM unix_example;
```

The output displays all the entries in the table in UNIX timestamp format (in milliseconds) in the **unix\_timestamp** column and in the timestamp format in the **timestamp\_value** column without timezone.

```sql
+-------------------------+-----------------------+
| unix_timestamp          | timestamp_value       |
+-------------------------+-----------------------+
|171472000000             | 1975-06-08 15:06:40   |
|1671975000000            | 2022-12-25 13:30:00   |
|153276000000             | 1974-11-10 00:40:00   |
+-------------------------+-----------------------+
```