How to add date from the temporary table to email? | Community
Skip to main content
New Participant
December 17, 2024
Solved

How to add date from the temporary table to email?

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ParthaSarathy
ParthaSarathyAccepted solution
New Participant
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

2 replies

ParthaSarathy
ParthaSarathyAccepted solution
New Participant
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") %>
Translate
 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
ArivuMuAuthor
New Participant
December 17, 2024

Thank you @parthasarathy  - It works now 🙏

Translate