- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 05:16 AM
Hi All,
Please advise how to convert duration result from second to hh:mm:ss (hours: Minutes: second).
On change script-
Script include -
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 05:37 AM
Hi Radhe,
Replace line 8 in script include with below.
var h = Math.floor(dur / 3600);
var m = Math.floor(dur % 3600 / 60);
var s = Math.floor(dur % 3600 % 60);
var finalis=h +':'+m+':'+':'+s;
return finalis;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 06:24 AM
Could you suggest what script i need to add if I need duration in days instead of HH:MM:SS?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 06:38 AM
Hi Radhe,
Add below updated line in script.
var h = Math.floor(dur / (3600*24));
Mark correct and helpful based on impact.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 06:57 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 07:10 AM
Hi,
You need to remove other lines.
var h = Math.floor(dur / (3600*24));
var finalis=h;
return finalis;
I hope above lines will do trick for you.
Mark correct and helpful based on impact.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 05:45 AM
Thank you so much Sir!!!