Skip to main content
Level 2
Jan 14, 2025 7:30 PM UTC
Solved

displaying a datetime field in AJO

Hi

 

So..... i have a column in the data schema called eventDate, it is string, date-time format in the standard format (ie 

2025-01-13T16:15:00Z) - In an AJO email I'd like to display this as both the date in the format 13-01-2025 and the time as 16:15
 
for the life of me I cant figure out the converting and formatting. any ideas?
DavidKangni
DavidKangniAccepted solution
Adobe Champion and Community Advisor
Jan 14, 2025 11:13 PM UTC

@marcst4 


  {%= formatDate(stringToDate(eventDate), "dd-MM-YYYY") %}
  {%= formatDate(stringToDate(eventDate), "HH:mm") %}

 

Thanks,

David

David Kangni

2 replies

DavidKangni
Adobe Champion and Community Advisor
DavidKangniAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
Jan 14, 2025 11:13 PM UTC

@marcst4 


  {%= formatDate(stringToDate(eventDate), "dd-MM-YYYY") %}
  {%= formatDate(stringToDate(eventDate), "HH:mm") %}

 

Thanks,

David

Translate
David Kangni
MarcSt4Author
Level 2
Jan 15, 2025 1:25 AM UTC

too easy 🙂 2 things has my measure, one was that I dont understand shy we need to convert string to date when the field is already a string with datetime format, but guess thats just the way it is.

 

the other thing that was causing issues, is that when using an event in AJO, referencing the date in the event, for some reason you need to put the event id in ''. Oh well, live and learn 🙂

Translate