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?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 11:16 AM
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);
Labels:
- Labels:
-
Scripting and Coding
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 04:24 AM
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.