Skip to main content

Overview

The format-date transformation formats a date value according to a predefined format pattern.

Syntax

format-date(<variable>, format="DATE_SHORT")

Parameters

ParameterTypeRequiredDescription
variabledateYesThe date value to format
formatstringYesThe predefined format key (see available formats below)
localestringNoThe locale for formatting (e.g., "en-US", "fr-FR"). Defaults to "fr-FR"
timezonestringNoThe timezone to use (e.g., "UTC", "Europe/Paris"). Defaults to "UTC"
inputLocalestringNoLocale used to parse the input date value: "pt", "nl", "en", "de", "ja", "zh", or "fr"

Available Formats

Format KeyDescription
DATE_SHORTShort date (e.g., 01/31/2024)
DATE_MEDIUMMedium date (e.g., January 31, 2024)
DATE_LONGLong date with weekday (e.g., Wednesday, January 31, 2024)
TIMETime with seconds (e.g., 14:30:00)
TIME_WITHOUT_SECONDSTime without seconds (e.g., 14:30)
HOURHour with padding (e.g., 02)
HOUR_WITHOUT_PADDINGHour without padding (e.g., 2)
MINUTES_AND_SECONDSMinutes and seconds (e.g., 30:00)
DAYDay of month (e.g., 31)
MONTHMonth number (e.g., 01)
DAY_MONTHDay and month (e.g., 31/01)
MONTH_NAMEMonth name (e.g., January)
YEARYear (e.g., 2024)
WEEKDAYWeekday name (e.g., Wednesday)
DATETIMEDate and time (e.g., January 31, 2024, 14:30)
DATETIME_MEDIUMMedium datetime (e.g., Wed, Jan 31, 14:30)
DATETIME_LONGLong datetime with weekday (e.g., Wednesday, January 31, 2024, 14:30)
ISOISO 8601 format (e.g., 2024-01-31T14:30:00.000Z)
TIMESTAMPUnix timestamp in milliseconds
TIMESTAMP_SECONDSUnix timestamp in seconds
TIMESTAMP_MILISECONDSUnix timestamp in milliseconds (alias of TIMESTAMP)

Examples

format-date(<variable>, format="DATE_SHORT")
format-date(<variable>, format="DATETIME", locale="fr-FR", timezone="Europe/Paris")
format-date(<variable>, format="ISO")