# Translate datetime format

## Description

This operation allows you to convert dates and times from one format to another. This is useful for standardizing timestamps, converting between systems with different date/time formats, or simply making a date more readable.

***

## Data types

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

### Input data

![](/files/V1VWE3z3CAP3dyGz83S8) - Strings representing the dates you want to convert.

### Output data

![](/files/FiO6hMIDNPuoHDSTAxHC) - Output formatted date strings.

***

## 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>Input Format<mark style="color:red;"><strong>*</strong></mark></summary>

Specify the format of your input date strings. Note that you must use the following date to represent it:

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

That means you must specify the format of your input dates using the date and time above. For example, for the following input date:

* `2024-10-24T14:11:13Z08:00`

You must specify the format as follows:

* `2006-01-02T15:04:05Z07:00`

These are the supported formats:

* Layout (for example `01/02 03:04:05PM '06 -0700`)
* ANSIC (for example `Mon Jan 2 15:04:05 2006`)
* UnixDate (for example `Mon Jan 2 15:04:05 PST 2006`)
* RubyDate (for example `Mon Jan 02 15:04:05 -0700 2006`)
* RFC822 (for example `02 Jan 06 15:04 MST`)
* RFC822Z (for example `02 Jan 06 15:04 -0700`)
* RFC850 (for example `Monday, 02-Jan-06 15:04:05 MST`)
* RFC1123 (for example `Mon, 02 Jan 2006 15:04:05 MST`)
* RFC1123Z (for example `Mon, 02 Jan 2006 15:04:05 -0700`)
* RFC3339 (for example `2006-01-02T15:04:05Z07:00`)
* RFC3339Nano (for example `2006-01-02T15:04:05.999999999Z07:00`)
* DateTime (for example `2006-01-02 15:04:05`)

</details>

<details>

<summary>Input Timezone</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>Output Format<mark style="color:red;"><strong>*</strong></mark></summary>

Specify the desired format of your output date strings. Note that you must use the following date to represent your required output format:

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

That means you must specify the format of your output dates using the date and time above. Following the example in the **Input Format** parameter, imagine you have this input date `2024-10-24T14:11:13Z` and set the **Input Timezone** to `UTC+1`.&#x20;

If you enter the following in the **Output Format** parameter:

* `2006-01-02 15:04:05`

and set **Output Timezone** to `UTC+8`, you will get this as your output date:

* `2024-01-02 21:11:13`

The following formats are supported for both the **Input Format** and **Output Format** parameters:

* Layout (for example `01/02 03:04:05PM '06 -0700`)
* ANSIC (for example `Mon Jan 2 15:04:05 2006`)
* UnixDate (for example `Mon Jan 2 15:04:05 PST 2006`)
* RubyDate (for example `Mon Jan 02 15:04:05 -0700 2006`)
* RFC822 (for example `02 Jan 06 15:04 MST`)
* RFC822Z (for example `02 Jan 06 15:04 -0700`)
* RFC850 (for example `Monday, 02-Jan-06 15:04:05 MST`)
* RFC1123 (for example `Mon, 02 Jan 2006 15:04:05 MST`)
* RFC1123Z (for example `Mon, 02 Jan 2006 15:04:05 -0700`)
* RFC3339 (for example `2006-01-02T15:04:05Z07:00`)
* RFC3339Nano (for example `2006-01-02T15:04:05.999999999Z07:00`)
* DateTime (for example `2006-01-02 15:04:05`)

</details>

<details>

<summary>Output Timezone</summary>

Specify the timezone of the output 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>

***

## Example

Suppose you want to convert a series of dates in the following format:

`MM-DD-YYYY HH:mm:ss`

into this one:

`ddd, D MMM YYYY HH:mm:ss ZZ`

1. In your Pipeline, open the required [Action](https://onum.gitbook.io/onum-docs/the-workspace/pipelines/actions) configuration and select the input **Field**.
2. In the **Operation** field, choose **Translate Datetime Format**.
3. Set **Input Format** to `01-02-2006 15:04:05`
4. Set **Input Timezone** to `UTC+1`
5. Set **Output Format** to `Mon, 2 Jan 2006 15:04:05 +0000`
6. Set **Output Timezone** to `UTC+1`
7. Give your **Output field** a name and click **Save**. The format of the dates in your input field will be transformed. For example:

<pre><code><strong>05-20-2023 10:10:45 -> Sat, 20 May 2023 10:10:45 +0000
</strong></code></pre>

{% 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/translate-datetime-format.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.
