Carrot reference
Functions

formatDate()

Converts a given value of type Date into a String.

Syntax

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

  • date - the date to be formatted, eg. startDateOrg
  • format - the format of the Date, eg. 'MM-dd-YYY'
  • locale - (optional) the language of the date, eg. 'es'

Sample usage

formatDate(startDateOrg) Returns the value of startDateOrg as a String.

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

formatDate(startDateOrg, 'mm-dd-yyyy','es') 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

String

If a Date value is passed, it's value will returned as a String.

Unsupported data types

Null

Unsupported data types return Null.