The CreatorCon Call for Content is officially open! Get started here.

How to calculate the difference between two dates (current date and start date) in business days?

pvn
Tera Contributor

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

Mayu
Tera Guru
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