# From Unix timestamp

## Description

This operation converts Unix timestamps into human-readable date and time formats. Unix timestamps represent the number of seconds (or milliseconds) that have elapsed since the Unix epoch, which began at 00:00:00 UTC on January 1, 1970.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

![](/files/h7UrtWFuEywAEF8hYv1A) - Integer values representing the Unix timestamps to be converted.

### Output data

![](/files/FiO6hMIDNPuoHDSTAxHC) - A string representing the formatted time.

***

## Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a <mark style="color:red;">**\***</mark>):

<details>

<summary>Time Unit<mark style="color:red;"><strong>*</strong></mark></summary>

Specify the unit of time represented by the input timestamp. Choose one of the following:

* **Seconds**
* **Milliseconds**
* **Microseconds**
* **Nanoseconds**

</details>

<details>

<summary>Timezone Output</summary>

Specify the timezone of the input date strings. Enter one of the following:

* `UTC`
* `GMT`
* `PST`
* `PDT`
* `CET`
* `CEST`
* Any IANA time zone

If not provided, the default value is `UTC`.

</details>

<details>

<summary>Format Output</summary>

Specify the desired format of your output date strings. If not provided, the default format is `ddd d mmm yyyy hh:mm:ss timezone` (for example, `Mon 2 Jan 2006 15:04:05 MST`)

Note that you must use the following date to represent your required output format:

* **Date** - `January 02, 2006`
* **Time** - `15:04:05`

For example, imagine you have this input timestamp `978346800` and you want to get the corresponding date in this format: `ddd dd mmm yyyy hh:mm:ss`

You must enter the following in the **Format** **Output** parameter, considering the date above:

* `02 January 2006 15:04:05`

You will get this as your output date:

* `12 January 1970 07:45:46`

You can use any date format supported by [Go](https://go.dev/doc/). For a complete list of supported formats, check [this article](https://pkg.go.dev/time#pkg-constants).

These are some of the supported formats:&#x20;

* RFC3339 (for example `2006-01-02T15:04:05Z`)
* ANSIC (for example `Mon Jan 2 15:04:05 2006`)
* UnixDate (for example `Mon Jan 2 15:04:05 PST 2006`)
* Custom format (for example `02-01-2006 15:04:05`)

{% hint style="warning" %}
Note that custom formats must have day, month, year, and time. For example, this format `Mon Jan 2 15:04:05`won't work, as it is missing the year.
{% endhint %}

</details>

***

## Example

Suppose you want to convert a series of **timestamps** into **human-readable date strings**:

1. In your Pipeline, open the required [Action](/the-workspace/pipelines/actions.md) configuration and select the input **Field**.
2. In the **Operation** field, choose **From Unix Timestamp**.
3. Set **Time Unit** to **Seconds**.
4. Set **Timezone Output** to `UTC`.
5. Set **Format Output** to `Mon 2 January 2006 15:04:05 UTC`
6. Give your **Output field** a name and click **Save**. The values in your input field will be transformed. For example:

```
Input data - 978346800

Time Unit - Seconds

Timezone Output - "UTC"

Format Output - "Mon 2 January 2006 15:04:05 UTC"

Output data - "Mon 1 January 2001 11:00:00 UTC"
```

{% hint style="info" %}
You can try out operations with specific values using the **Input** field above the operation. You can enter the value in the example above and check the result in the **Output** field.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/pipelines/actions/transformation/field-transformation/field-transformation-operations/date-time/from-unix-timestamp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
