---
title: formatDate()
slug: formatdate
docTags: 
createdAt: 2021-09-14T17:46:11.000Z
---

Converts a given value of type `Date` into a `String`.&#x20;

### Syntax

`formatDate(date,'format','locale')`

- `date` - the date to be formatted, eg. `startDateOrg`
- `format` - the format of the Date, eg. `'MM-dd-YYY'`
  - Supports any formatting inputs [from date-fns](https://date-fns.org/v3.3.1/docs/format).
- `locale` - (optional) the language of the date, eg. `'es'`
  - Default: `'en-US'`- American English
  - Supports any [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag).&#x20;

### Sample usage

`formatDate(startDateOrg)`&#x20;
Returns the value of `startDateOrg` as a `String`. &#x20;

`formatDate(startDateOrg, 'EEEE, dd MMMM YYYY)`&#x20;
Returns the value of the `startDateOrg` formatted as a `String` for example "Wednesday, 15 June 2022."

`formatDate(startDateOrg, 'mm-dd-yyyy','es')`&#x20;
Returns the value of `startDateOrg` as a `String` in Spanish for example "Miercoles, 14 junio 2022"

### Supported data types

| **Input type**                            | **Return type**                         | **Logic**                                                        |
| ----------------------------------------- | --------------------------------------- | ---------------------------------------------------------------- |
| ****[Date](docId\:xTAQdzvLBTAKjxRnpFwe9)  | [String](docId\:Ujw2AQAktel5uukLuP73S)  | If a Date value is passed, it's value will returned as a String. |
| *Unsupported data types*                  | **[Null](docId\:N9trVqonnBknqL9DrNBP6)  | Unsupported data types return `Null`.                            |

