---
title: fromUnixTime
description: |
  Returns a parsed timestamp from a numeric Unix time value.

  The Unix epoch starts on January 1, 1970. Timestamps before this are represented by negative numbers.
url: https://coralogix.com/docs/dataprime/language-reference/functions-reference/time/fromunixtime/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `fromUnixTime`

## Description

Returns a parsed timestamp from a numeric Unix time value.

The Unix epoch starts on January 1, 1970. Timestamps before this are represented by negative numbers.

## Syntax

Like many functions in DataPrime, `fromUnixTime` supports<!-- --> [two notations](https://coralogix.com/docs/dataprime/language-reference/functions-reference.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
fromUnixTime(unixTime: number, timeUnit?: timeunit): timestamp
```

```
(unixTime: number).fromUnixTime(timeUnit?: timeunit): timestamp
```

## Arguments

| Name       | Type       | Required  | Description                                         |
| ---------- | ---------- | --------- | --------------------------------------------------- |
| `unixTime` | `number`   | **true**  | The Unix timestamp to convert                       |
| `timeUnit` | `timeunit` | **false** | The unit of the Unix timestamp. Defaults to `milli` |

## Example

**Use case: Convert a numeric Unix timestamp to a proper timestamp**

Interpret a numeric value as milliseconds since the epoch and convert it into a `timestamp`.

### Example query

* Function notation
* Method notation

```
choose fromUnixTime(1658958157515, 'ms') as ts
```

```
choose 1658958157515.fromUnixTime('ms') as ts
```

### Example output

```
{

  "ts": 1658958157515000000

}
```
