Skip to main content
Inspiring
December 8, 2021
Answered

Add date + 20 work days to stamp

  • December 8, 2021
  • 3 replies
  • 1321 views

Hi, 

I would like to stamp a date + 20 days from the current date. 

I can get the date working with this script within a stamp, but how do I add 20 workingdays to this?

 

event.value = util.printd("dd/mm/yyyy", new Date());

 

Best regards

//Mikkel

This topic has been closed for replies.
Correct answer mikkelv32837334

It worked! great!

 

just a small spelling mistake %s in the last line: 

var newDate = new Date();
newDate.setDate( newDate.getDate() + 20)
event.value = util.printd("dd/mm/yyyy", newDate);

3 replies

try67
Community Expert
Community Expert
December 9, 2021

Do you want to add 20 days, or 20 working days? The latter is much more complicated, especially if you want it to ignore holidays.

Inspiring
December 9, 2021

I want to add +20 working days - so yes it should ignore holidays, if possible?

BarlaeDC
Community Expert
Community Expert
December 8, 2021

Hi,

 

You should be able to do something like this

 

 

var newDate = new Date();
newDate.setDate( newDate.getDate() + 20)
event.value = ustil.printd("dd/mm/yyyy", newDate);

 

mikkelv32837334AuthorCorrect answer
Inspiring
December 9, 2021

It worked! great!

 

just a small spelling mistake %s in the last line: 

var newDate = new Date();
newDate.setDate( newDate.getDate() + 20)
event.value = util.printd("dd/mm/yyyy", newDate);
Bernd Alheit
Community Expert
Community Expert
December 8, 2021
Inspiring
December 9, 2021

Thanks - I tried this, but it didnt do the trick.