Date/Time Formatter workflow action
The Date/Time Formatter action reformats dates and date-times, compares two dates, calculates the difference between them in days, and stores the result as a dynamic variable that later workflow actions can use. It has three action types: Format Date, Format Date-Time, and Compare Dates.
Add the Date/Time Formatter action
Add the action from a new or existing workflow, then configure it in the action modal. It is part of the Workflow actions catalog; for how triggers and actions fit together, see Workflows Overview.
Open Automations > Create Workflow and select + Start from Scratch, or open an existing workflow.
Click the + icon where the action should run, then select Date/Time Formatter from the available actions.
Configure the action, then click Save Action.
The action modal is titled Date/Time Formatter with the subtitle "Format and Compare date fields". It offers ACTION NAME, ACTION TYPE, FIELD, FROM FORMAT, and TO FORMAT, plus Cancel and Save Action buttons. In ACTION TYPE, choose Format Date, Format Date-Time, or Compare Dates.
Format Date
Format Date converts a date-only value from one format to another. Choose the source in FIELD, then set FROM FORMAT and TO FORMAT.
The FIELD sources are Specific Date, Current Date, Contact date fields, date-type custom fields, Appointment start/end date, Custom Values, and Inbound Webhook Trigger.
For system fields — Specific Date, Current Date, Contact standard date fields, Contact date-type custom fields, and Appointment start/end date — the tool auto-detects and preselects the format in FROM FORMAT. For Custom Values and Inbound Webhook Trigger, select the matching format manually.
The available date formats are:
YYYY-MM-DD(2023-12-21)MM-DD-YYYY(12-21-2023)MM/DD/YYYY(12/21/2023)MM/DD/YY(12/21/23)DD-MM-YYYY(21-12-2023)DD/MM/YYYY(21/12/2023)
Format Date-Time
Format Date-Time converts a value that contains both a date and a time into the format you choose. The FIELD sources are Specific Date and Time, Current Date and Time, Appointment start/end date and time, Custom Values, and Inbound Webhook Trigger.
As with Format Date, the format is auto-detected and preselected for the system fields; for Custom Values and Inbound Webhook Trigger, select the matching format manually. A From Format value such as dddd, MMMM D, YYYY hh:mm A displays as Saturday, December 21, 2023 1:30 PM.
The TO FORMAT options are:
ddd MMM DD HH:mm:ss YYYY(Sat Dec 21 13:30:59 2023)MMMM DD YYYY HH:mm:ss(December 21 2023 13:30:59)YYYY-MM-DD HH:mm:ss(2023-12-21 13:30:59)YYYY-MM-DD hh:mm A(2023-12-21 1:30 PM)DD/MM/YYYY HH:mm:ss(21/12/2023 13:30:59)MM/DD/YYYY hh:mm A(12/21/2023 1:30 PM)
Contact custom fields do not support the Date Time structure, so a custom field value can't be used with Format Date-Time; use Format Date for custom field values instead.
Compare Dates
Compare Dates calculates the difference between two dates in days, as End Date minus Start Date. Start Date and End Date each offer the same source categories.
The Start Date Format is auto-detected and preselected for system fields; for Custom Values and Inbound Webhook Trigger, select the matching format manually. A format such as MMMM D, YYYY displays as December 21, 2023.
If the Start Date is later than the End Date, the result is negative. You can compare a contact date field with the current date — for example Signup Date or Last Purchase Date — and the difference is stored in {{datetime_formatter.1.days}}.
Use the output variables
The action stores its output in three variables you can use in later actions: {{datetime_formatter.1.date}}, {{datetime_formatter.1.datetime}}, and {{datetime_formatter.1.days}}.
{{datetime_formatter.1.days}} holds the day difference from Compare Dates. Use the generated variables anywhere the workflow needs the formatted value — in emails, when updating contact fields, or in conditional workflow branches.
Timezones and format mismatches
The action processes dates and times according to the system's default timezone settings. When contacts are in different time zones, standardize or convert the values before formatting.
If FROM FORMAT does not match the actual structure of the date value, the workflow can fail to process the date correctly, and the action can produce missing or incorrect values.