dynamic date in email body | Community
Skip to main content
Level 2
July 3, 2023
Solved

dynamic date in email body

  • July 3, 2023
  • 1 reply
  • 2866 views

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.
Best answer by SatheeskannaK

@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") %}

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
July 3, 2023

@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
Level 2
July 13, 2023

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. 

Zahid_14
Level 2
August 21, 2023

@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?