Skip to main content
Level 2
Jul 3, 2023 1:12 AM UTC
Solved

dynamic date in email body

Hi Team,

 

We are trying to populate the dynamic offer end date in email creative base on journey run date + 30 days in specific format.

Did anyone can help me on the same? I can populate the date (2023-07-02) but want in MM/DD/YYYY format

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SatheeskannaK
SatheeskannaKAccepted solution
Adobe Champion, Community Advisor, UG Leader
Jul 3, 2023 5:11 PM UTC

@st_questions,

You can use the formatDate function to display the date format as MM/DD/YYYY.

{% let d=now %}
{%= formatDate(d, "mm/dd/YYYY") %}

Thanks, Sathees

12 replies

SatheeskannaK
Adobe Champion, Community Advisor, UG Leader
SatheeskannaKAdobe Champion, Community Advisor, UG LeaderAccepted solution
Adobe Champion, Community Advisor, UG Leader
Jul 3, 2023 5:11 PM UTC

@st_questions,

You can use the formatDate function to display the date format as MM/DD/YYYY.

{% let d=now %}
{%= formatDate(d, "mm/dd/YYYY") %}

Translate
Thanks, Sathees
Level 2
Jul 13, 2023 2:41 AM UTC

Thanks, similar type of syntax is working for me in email body.

 

Want to utilize in the SMS but it is not working.

Updating the offer end date ( now + 30days) in datetime column 

same column passing in the SMS attributes and want date format mm/dd/yy but it is not working. 

Translate
Zahid_14
Level 2
Aug 21, 2023 8:12 AM UTC

@satheeskannak 
It  is also working for me:
{% let d=now %}
{%= formatDate(d, "mm/dd/YYYY") %}

But I need to add +7 days. That is not working. addDates or addDays function does not work. I have tried set days
{% let d = today %}
{%= formatDate(setDays(d,7), "D/MM/YYYY") %}
But it gives wrong output like 217/08/2023

Could you please help? 

@st_questions 
Have you found any solution? If yes, could you please share it? 

Translate