Im trying to use a date time attribute coming from a context attribute which then I need to format and put it inside an email | Community
Skip to main content
riballor
Level 3
March 18, 2026
Question

Im trying to use a date time attribute coming from a context attribute which then I need to format and put it inside an email

  • March 18, 2026
  • 1 reply
  • 5 views

This is the script that Im testing

 

Your appointment time: {%= formatDate(context.journey.events.1697323153.timestamp,"dd/MM/yyyy HH:mm") %} 

 

But Im getting this error: Invalid syntax Invalid syntax Error in parsing PQL expression "formatDate(context.journey.events.1697323153.timestamp,"dd/MM/yyyy HH:mm:ss")": line 1:10 mismatched input '(' expecting <EOF>. Error beginning at position: Line 1, Character 24

Can someone help!

1 reply

SatheeskannaK
Community Advisor
Community Advisor
March 18, 2026

@riballor Try this,

{% let newDate = formatDate(toDateTime(context.journey.events.`1697323153`.timestamp), "dd/MM/yyyy HH:mm") %}

{{newDate}}

Thanks, Sathees