Calculate the business duration using a scheduleIssue When using a schedule, the difference between two dates is calculated correctly but the value is saved without any schedule. For example, using a 12-hour schedule, if the time to resolve is 38 hours (which is 3 days 2 hours using 12-hour schedule), it is saved as 1 day 14 hours (using 24-hour schedule).ResolutionUse the out-of-the-box (OOTB) PlannedTaskAPI. Below is the sample code using this API, which will return the difference between '2019-06-10 08:00:00' and '2019-06-13 10:00:00' using '8-5 weekdays' schedule. So the return value will be '3 02:00:00' (using 8-5 schedule) instead of '1 02:00:00' (using 24-hour schedule) var startDateString = '2019-06-10 08:00:00';var endDateString = '2019-06-13 10:00:00';//sys_id of the '8-5 weekdays' schedule in OOTB.var scheduleId = '08fcd0830a0a0b2600079f56b1adb9ae';//PlannedTaskAPI is used to calculate the duration on Planned Task//based on the Start Date, End Date and Schedulevar plannedTaskAPI = new SNC.PlannedTaskAPI();var resp = plannedTaskAPI.calculateDuration(startDateString, endDateString, scheduleId);var response = new JSON().decode(resp);var duration = response.duration;