Skip to content

Date Functions

Date functions format and generate date/time values. Dates are handled as strings in PHP date format.

date_format

Formats a date string using a PHP date format.

Signature: date_format(date, format?)

ParameterTypeDefaultDescription
datestring--The date string to format. Accepts most date formats (YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, timestamps, relative strings).
formatstringY-m-dPHP date format string.
`{ {date_format(row.created_at, 'F j, Y')}}`
// "2025-03-15 14:30:00" → "March 15, 2025"

`{ {date_format(row.event_date, 'm/d/Y')}}`
// "2025-03-15" → "03/15/2025"

`{ {date_format(row.updated_at, 'M j, g:i A')}}`
// "2025-03-15 14:30:00" → "Mar 15, 2:30 PM"

If the input date cannot be parsed, the current time is used as a fallback.

Common Format Strings

FormatExample Output
Y-m-d2025-03-15
F j, YMarch 15, 2025
m/d/Y03/15/2025
d.m.Y15.03.2025
D, M jSat, Mar 15
l, F j, YSaturday, March 15, 2025
g:i A2:30 PM
H:i14:30
M j, Y g:i AMar 15, 2025 2:30 PM
Y-m-d\TH:i:s2025-03-15T14:30:00 (ISO 8601)

PHP Format Tokens

TokenDescriptionExample
Y4-digit year2025
y2-digit year25
FFull month nameMarch
MShort month nameMar
mMonth (zero-padded)03
nMonth (no padding)3
dDay (zero-padded)05
jDay (no padding)5
lFull day nameSaturday
DShort day nameSat
HHour 24h (zero-padded)14
hHour 12h (zero-padded)02
gHour 12h (no padding)2
iMinutes30
sSeconds00
AAM/PMPM
aam/pmpm

now

Returns the current date and time in Y-m-d H:i:s format (UTC).

Signature: now()

`{ {now()}}`
// "2025-03-15 14:30:00"

Commonly used in pipeline Set Field nodes:

fieldName: "created_at"
expression: "now()"

today

Returns the current date in Y-m-d format (UTC).

Signature: today()

`{ {today()}}`
// "2025-03-15"

Useful for filtering:

row.event_date == today()

Examples

Display "time ago" style text (approximation)

Posted on `{ {date_format(row.created_at, 'M j, Y')}}`

Set timestamp on form submission

In a Set Field node:

fieldName: "submitted_at"
expression: "now()"

Compare dates in conditions

row.expires_at < today()
// true if the expiry date is in the past

Format for different regions

// US format
`{ {date_format(row.date, 'm/d/Y')}}`

// European format
`{ {date_format(row.date, 'd.m.Y')}}`

// ISO format
`{ {date_format(row.date, 'Y-m-d')}}`