Expand my Community achievements bar.

Join us for the Community Q&A Coffee Break on May 2nd at 8 am PT with Adobe Journey Optimizer experts Robert Calangiu, Brent Kostak & Sandra Hausmann.
SOLVED

Convert timestamp to readable format

Avatar

Level 1

Hello all,

How I can display 2022-12-11T07:13:04Z timestamp to 11/12/2022 07:13:04 EST format. Could not find any useful helper function.

Tried following codes-

{%= stringToDate(context.journey.events.`eventId`.timestamp).getMonth() %} + "/" +
{%= stringToDate(context.journey.events.`eventId`.timestamp).getDayOfYear() %} + "EST" 

Output -

12 + "/" + 2022 + "EST" 

 

Tried following codes-

{% let var1 = split(context.journey.events.`eventId`.timestamp,"T") %}

{{var1}}

 

Output -

List(2022-12-11, 07:13:04Z)

 

Thank you for any help or guide.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @rupaul_20 

 

You can use this code

concat(format(context.journey.events.`eventId`.timestamp,"dd/MM/yyyy HH:mm:ss")," EST")

 

Working example:

Manoj_Kumar__0-1673266406908.png

 


     Manoj
     Find me on LinkedIn

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @rupaul_20 

 

You can use this code

concat(format(context.journey.events.`eventId`.timestamp,"dd/MM/yyyy HH:mm:ss")," EST")

 

Working example:

Manoj_Kumar__0-1673266406908.png

 


     Manoj
     Find me on LinkedIn

Avatar

Community Advisor

@rupaul_20,

 

One thing to either consider or make sure that the event id timestamp that you capture in AJO is in EST. Usually, the default timestamp will be on UTC.

 

Thanks!

Thanks, Sathees