Function Not Calculating Duration Correctly – Showing Incorrect Time

BMelisa
Tera Contributor

Hello, ServiceNow Community!

I’m running into an issue with a custom function that’s supposed to calculate the duration between the request creation date and the closed time, but the results are not correct.

For example, in the attached screenshot, the request was opened for about a month, but the calculated duration is showing as only 2 hours and 51 minutes.

I’ve double-checked the function and the fields being referenced, but I can’t figure out why the calculation is incorrect. I’ve also reviewed several similar solutions on the community, but none of them have resolved the issue.

Here is how the function field is setup:

BMelisa_0-1737995389704.png

This is the output:

BMelisa_1-1737995417020.png

 

0 REPLIES 0