Dynamic content component date | Community
Skip to main content
September 28, 2023
Question

Dynamic content component date

  • September 28, 2023
  • 1 reply
  • 877 views

Hi,

I want to add a date that is 30 days after the email is sent. So, which HTML tag or code do I need to mention in the Email template?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Parvesh_Parmar
Community Advisor
Community Advisor
September 28, 2023

Hello @rasiksj0311

 

Please try the following code in HTML : 

<% var currentDateMinus30 = new Date(); currentDateMinus30.setDate(currentDateMinus30.getDate() - 30); %> <p><%= formatDate(currentDateMinus30, "%2D/%2M/%4Y") %> </p>

 

 

I tried this code and it is working. 

PFA Screenshot: 

 

Kr,

Parvesh

 

Parvesh Parmar – Adobe Community Advisor https://www.linkedin.com/in/parvesh-parmar/
October 19, 2023

Thanks Parvesh!

 

I tried this code and it is working on email. But when it moved on the web it shows the current date + 30 days. It should be the same on email and web versions also. Do you have any idea about this, how the date on webmail will be the same as on email?

 

I appreciate your help in advance.

Sukrity_Wadhwa
Community Manager
Community Manager
October 31, 2023

Hi @parvesh_parmar,

Could you please help @rasiksj0311 further with their query?

Thanks!

Sukrity Wadhwa