I am trying to fetch the date from present date to past date of 3 business days,i am using below script but it fetches the future date..Can any one suggest me which script i need to use for past days of business days?

Chaitanya6
Tera Contributor

var startDate = new GlideDateTime();
var days = 3;
var dur = new GlideDuration(60 * 60 * 24 * 1000 * days);
var schedule = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828');
var end = schedule.add(startDate, dur);

gs.print(startDate);
gs.print(end);

5 REPLIES 5

Hi Sanjiv,

I tried your script but the results is not the expected result.

see below results:

*** Script: 2022-04-22 11:21:17
*** Script: 2022-04-22 11:21:17

 

Thanks,

Chaitanya.