- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 05:13 AM
Hi Saurav,
As I am checking for the difference of 2 dates excluding holidays, I have written below script, where in I got something like below
var start= new GlideDateTime(date1);
var end= new GlideDateTime(date2);
var dc= new DurationCalculator();
dc.setSchedule('f4db82011b36a010cb721f42b24bcb27');
var time = dc.calcScheduleDuration(start,end);
gs.log(time);
In the log, I got 907200(milliseconds), but where in my date1 is 15-06-2022 07:54:37 and date2 is 24-07-2022 14:02:37. Considering there is no holiday in between this and my schedule is 8 am - 5 pm excluding holidays, it should be 27 days right? How to convert to number of days and also let me know if I am missing anything?