Get the difference in seconds between Current Date time and a Date Time Field

Martin Nguyen
Tera Contributor

I am writing a business rule that will check a box if a Due Date Time is more then 5 days from the current date. What is the best way to calculate that?

1 REPLY 1

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

You can use the gs.dateDiff(startDate, endDate, true) function:


GlideSystem - Global



The true at the end will make it return the value in seconds.   Then you can convert seconds into days.