How to calculate the difference between two dates (current date and start date) in business days?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 02:23 AM
Hi All,
I need to calculate difference between start date of an employee and today's date in business days using a schedule defined. What is the simplest way to achieve this?
Thanks in advance.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 12:47 AM
var startdate = new GlideDateTime(current.getValue('start_date'));
var end date = new GlideDateTime();
var dur = new GlideDuration();
dur =gs.dateDiff (startdate, end date); //the difference between
gs.addInfoMessage("Date Difference"+dur);
Please Mark Helpful
Thanks
Mayuri