How to add date from the temporary table to email? | Adobe Higher Education
Skip to main content
December 17, 2024
Resuelto

How to add date from the temporary table to email?

  • December 17, 2024
  • 1 respuesta
  • 496 visualizaciones

Hi there,
Could anyone assist with the personalisation token issue below?

I’ve added the target data attribute as: Date: <%= targetData.expStartDate %>. However, in the test email delivery, the date appears with a timestamp, e.g., Date: Sat Dec 28 2024 05:30:00 GMT+0000 (Coordinated Universal Time).

Could someone help with the code to display only the date in this format: Date: 09 Jan 2024?

Additionally, we are passing both date and time in the date variable. How can we split them into two separate attributes, such as:
Date: 09 Jan 2024
Time: 09:00?

Thank you! 
Arivu.

Este tema ha sido cerrado para respuestas.
Mejor respuesta de ParthaSarathy

Hi @arivumu ,

You can use the below script,

Attribute : <%= targetData.expStartDate %> Date in 01 Jan 2024 format : <%= formatDate(targetData.expStartDate, "%2D %B %4Y") %> Time in hh:mm:ss format : <%= formatDate(targetData.expStartDate, "%2H:%2N:%2S") %>

1 respuesta

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorRespuesta
Community Advisor
December 17, 2024

Hi @arivumu ,

You can use the below script,

Attribute : <%= targetData.expStartDate %> Date in 01 Jan 2024 format : <%= formatDate(targetData.expStartDate, "%2D %B %4Y") %> Time in hh:mm:ss format : <%= formatDate(targetData.expStartDate, "%2H:%2N:%2S") %>
~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
ArivuMuAutor
December 17, 2024

Thank you @parthasarathy  - It works now 🙏