displaying a datetime field in AJO | Community
Skip to main content
Level 2
January 14, 2025
Solved

displaying a datetime field in AJO

  • January 14, 2025
  • 1 reply
  • 636 views

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?
Best answer by DavidKangni

@marcst4 


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

 

Thanks,

David

1 reply

DavidKangni
Community Advisor
DavidKangniCommunity AdvisorAccepted solution
Community Advisor
January 14, 2025

@marcst4 


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

 

Thanks,

David

David Kangni
MarcSt4Author
Level 2
January 15, 2025

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 🙂