


Hi All,
I am using the 'formatDate' to get the current date, but I would also like to add 60 days to the current date.
<%= formatDate(new Date(), "%2M/%2D/%4Y") %>
Views
Replies
Sign in to like this content
Total Likes
Hi @StrawHatM23,
You can have a content block with this code and see if that helps,
<%
var date = new Date();
// Add x days to specified date
date.setDate(date.getDate() + 60);
var newdate = ("0"+(date.getMonth()+1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) + "/" + date.getFullYear();
document.write(newdate);
%>
Output: 03/24/2023
Thanks!
Hi @StrawHatM23,
You can have a content block with this code and see if that helps,
<%
var date = new Date();
// Add x days to specified date
date.setDate(date.getDate() + 60);
var newdate = ("0"+(date.getMonth()+1)).slice(-2) + "/" + ("0" + date.getDate()).slice(-2) + "/" + date.getFullYear();
document.write(newdate);
%>
Output: 03/24/2023
Thanks!