Skip to main content
Participant
August 12, 2022
Answered

Create Custom Dynamic Stamp with Future Date

  • August 12, 2022
  • 1 reply
  • 1525 views

Hello,

 

I am trying to create a custom dynamic stamp that posts a future date. For example, when I open my custom stamp on a document I want the date to display 9 days later. I have followed the tutorial on how to create a custom dynamic stamp, but I am unable to find javascript that will work to output a future date.  I have tried looking online for future date javascript that should theoretically work, but it doesn't work in my stamp or just even when I play around with form fields. Can someone please help?

 

The current date script I have is:

event.value = (new Date()).toString();
AFDate_FormatEx("mmm dd, yyyy");

 

Thank you,

 

Lynnette

This topic has been closed for replies.
Correct answer Nesa Nurani

Try this:

var d1 = util.scand("mmm dd, yyyy",new Date());
d1.setDate(d1.getDate() +9);
event.value = util.printd("mmm dd, yyyy", d1);

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
August 12, 2022

Try this:

var d1 = util.scand("mmm dd, yyyy",new Date());
d1.setDate(d1.getDate() +9);
event.value = util.printd("mmm dd, yyyy", d1);

Participant
August 12, 2022

That's great! Yes, thank you so much. It worked!