Creating Date Due stamp

I'm not a Java person. I have created a stamp that adds today's date to the stamp using event.value = (new Date()).toString(); AFDate_FormatEX('h:MM tt, mmm dd, yyyy');

I want to be able to add a Due Date stamp that would add 30 days to today's date. Can this be done? Is there a script you could send me?



Peter Applin

3 Answers

Yes it can. Have you looked for adding days to a date in the forums?

By the way Java is a programming language and is very different from JavaScript.

George Kaiser   

Try this code:

var oDate = new Date(); // get date object; oDate.setDate(oDate.getDate() + 30); // add 30 days; event.value = util.printd("h:MM tt, mmm dd, yyyy", oDate); // format field;

George Kaiser   

Thanks George, for whatever reason I did not see your reply. I'm seeing it now as I did another Google search trying to figure this out.

I copy/pasted the javascript (someone pointed that out as well :) into my javascript editor, but no date was created. Am I missing something? I am trying to create a custom stamp in Acrobat Pro XI. I have other stamps that calculate today's date, and they work just fine. I have tried several different scripts and none seem to work. Do I need the script to add today's date, then add the script that you supplied me? Sorry if I'm not being clear.

Peter Applin   

Please specify a reason: