Format Date
What does it do?
Formats a date value into a specific output format. Useful for displaying dates from CRM data or API responses in a human-readable format. The result is stored as a plain string at %state:node.<node_name>%. Formatting is locale-aware based on the bot's current language.
1. Syntax
<node_name>:
type: func
func_type: system
func_id: formatDate
params:
input: "<date value or data injection>"
format: "<output format>"
inputFormat: "<input format>"
on_complete: <next_node>
required params
typetype of the nodefunc_typehere it will be a system functionfunc_idwhat function are we calling (formatDate)params.inputthe date value to format — can be a string or integer, supports data injectionon_completenext node
optional params
params.inputFormatthe format of the input date. One of:"timestamp_ms"— millisecond timestamp (default)"timestamp"— second timestamp"iso"— ISO 8601"rfc2822"— RFC 2822
params.formatthe desired output format using Luxon tokens (default:"ISO"for full ISO string; use"ISODate"for date-only ISO)params.formatTimezoneIANA timezone for the output (e.g.,"Asia/Jerusalem"). Defaults to the customer's configured timezoneon_failurefallback nodedepartmentassigns the chat to a departmentagentassigns the chat to a specific agent (email address or CRM ID as defined in the Texter agents manager)
2. Examples
Format an ISO date to dd/MM/yyyy
format_date:
type: func
func_type: system
func_id: formatDate
params:
input: '%chat:crmData.order.DUEDATE%'
format: "dd/MM/yyyy"
inputFormat: "iso"
on_complete: show_date_to_user
Format with timezone
format_appointment_date:
type: func
func_type: system
func_id: formatDate
params:
input: '%state:store.appointmentDate%'
format: "dd/MM/yyyy HH:mm"
inputFormat: "iso"
formatTimezone: "Asia/Jerusalem"
on_complete: confirm_appointment
Format a millisecond timestamp (default inputFormat)
format_timestamp:
type: func
func_type: system
func_id: formatDate
params:
input: '%state:node.get_order.response.createdAt%'
format: "dd/MM/yyyy"
on_complete: show_order_date
Get date-only ISO string
format_iso_date:
type: func
func_type: system
func_id: formatDate
params:
input: '%chat:crmData.birthDate%'
inputFormat: "iso"
format: "ISODate"
on_complete: next_step
Locale-aware formatting
The output respects the bot's current language (set via Set Language). For example, month names and day names will appear in the bot's language:
format_readable_date:
type: func
func_type: system
func_id: formatDate
params:
input: '%state:store.eventDate%'
inputFormat: "iso"
format: "dd MMMM yyyy"
on_complete: show_event_date
tip
The formatted result is stored as a plain string at %state:node.<node_name>% — not nested under a key. Use it directly in subsequent messages.