Skip to main content

Format Date Mutation

The Format Date mutation allows you to format a date value into a specific string representation. It accepts dates, Unix timestamps, and date strings, and returns a formatted string. This is useful for ensuring dates in your product feed match the required format for different advertising channels.

Warning

If the input value cannot be parsed as a date, the mutation will return no value.

Options

  • Format: The format to apply to the date. Choose from a preset or select "Custom" to enter your own token string.

Presets

PresetExample outputToken string
ISO 86012026-03-18T14:05:09+0000YYYY-MM-DDTHH:mm:ssZ
Date (ISO)2026-03-18YYYY-MM-DD
Date (US)03/18/2026MM/DD/YYYY
Date (EU)18/03/2026DD/MM/YYYY
Date & time (US)03/18/2026 02:05 PMMM/DD/YYYY hh:mm A
Date & time (EU)18/03/2026 14:05DD/MM/YYYY HH:mm
Unix timestamp1742306709X
Unix timestamp (ms)1742306709000x
RFC 2822Wed, 18 Mar 2026 14:05:09 +0000ddd, DD MMM YYYY HH:mm:ss Z
Custom(your own format)(any token combination)

Custom Format Tokens

When using the "Custom" option, you can combine the following tokens:

TokenMeaningExample
YYYY4-digit year2026
YY2-digit year26
MMMMFull month nameMarch
MMMAbbreviated monthMar
MMZero-padded month03
MMonth without padding3
ddddFull weekday nameWednesday
dddAbbreviated weekdayWed
DDZero-padded day18
DDay without padding18
HH24-hour hour14
hh12-hour hour padded02
h12-hour hour2
mmMinutes05
ssSeconds09
AAM/PM uppercasePM
aam/pm lowercasepm
ZZTimezone offset with colon+00:00
ZTimezone offset+0000
XUnix timestamp (seconds)1742306709
xUnix timestamp (milliseconds)1742306709000
Note

X and x are special tokens that cannot be combined with other tokens. If used, the entire format string must be just X or x.

Literal text

Wrap any text in square brackets to include it verbatim in the output without token substitution:

[Today is] dddd, MMMM DD YYYY, h:mm:ss aToday is Wednesday, March 18 2026, 2:05:09 pm

Example

Formatting a product's on_sale_to as MM/DD/YYYY.

A screenshot showing the Format Date mutation.
Format Date Mutation Example