# convert-date-to-text

## Description

<mark style="color:purple;">`convert-date-to-text`</mark> *adaptor can be used to convert a date/time value to text in a specified format.*

If no input value is provided, the current date/time will be used.

## Inputs

**`value`**\
Type: `text`\
Required: No\
The input date/time value. If unspecified, the current date/time will be used.

**`format`**\
Type: `text`\
Required: No\
The format of data in column one based on [Unicode Technical Standard #35](< https://date-fns.org/v2.0.1/docs/parse#:~:text=Accepted%20format%20string%20patterns%3A>). If unspecified, defaults to ISO 8601 date/time.

**`locale`**\
Type: `text`\
Required: No\
A l[anguage locale](< https://date-fns.org/v2.28.0/docs/Locale>) to be used when formatting the values. If unspecified, it defaults to `en-US`.

**`timezone`**\
Type: `text`\
Required: No\
The three letter code of the timezone (e.g., UTC).

## Outputs

**`text`**\
Type: `text`\
The date as a formatted text.

## Examples

### Example 1: Default behaviour.

#### Inputs:

No inputs provided.

#### Outputs:

`text`: 2020-02-28T08:00:00+00:00

-> As no inputs were provided, the current date/time was retuned.

### Example 2: Formatted date.

#### Inputs:

`format`: MM/dd/yyyy

#### Outputs:

`text`: 02/28/2020

-> Provided a format to return a month-day-year date string.

### Example 3: Formatted time.

#### Inputs:

`format`: HH:mm

#### Outputs:

`text`: 08:00

-> Provided a format to return only the current time.

### Example 4: Formatted time with locale code.

#### Inputs:

`format`: MMMM

`locale`: es

#### Outputs:

`text`: febrero

-> In this example, we set `locale` input to `es` (the [ISO 639 language code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) for Spanish) to get the name of the current month in Spanish.

## Use Cases

* Adding a timestamp by leaving the input date/time blank.&#x20;


---

# 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://cgps.gitbook.io/data-flo/reference-guide/convert-date-to-text.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.
