---
title: "to_timestamp function in Strata | Oplema"
description: "Convert seconds since 1970-01-01 to a timestamp with time zone. Write it as to_timestamp(sec) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/to-timestamp"
updated: "2026-11-04"
---

# to\_timestamp

Convert seconds since 1970-01-01 to a timestamp with time zone.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **TIMESTAMP WITH TIME ZONE**.

### Expression

```
to_timestamp(1284352323.5)
```

### Result

```
2010-09-13 04:32:03.5+00
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 2010-09-13 04:32:03.500 |

## Arguments and types

```
to_timestamp(sec)
```

**sec**

Number

Supported signatures (1)

```
to_timestamp(sec: DOUBLE) → TIMESTAMP WITH TIME ZONE
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[make\_timestamp

Build a timestamp from a year, month, day, hour, minute and seconds.

](https://oplema.com/docs/strata/functions/make-timestamp)[make\_timestamp\_ms

Build a timestamp from the number of milliseconds since 1970-01-01.

](https://oplema.com/docs/strata/functions/make-timestamp-ms)[make\_timestamp\_ns

The timestamp for the given nanoseconds since epoch.

](https://oplema.com/docs/strata/functions/make-timestamp-ns)[strptime

Parse text into a timestamp using a format string such as %d/%m/%Y. Text that doesn't match raises an error; use try\_strptime to get a missing value instead.

](https://oplema.com/docs/strata/functions/strptime)

[Browse dates & times](https://oplema.com/docs/strata/functions#dates-&-times) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/timestamptz.html#to_timestampdouble)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
