How to replace space in the business duration value & replace it with :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 05:18 AM
calculating the pending duration for an Incident (Pending Start Date, Current date)
eg: Its giving me the value as 1 04:45:47 (days hr:mm:ss)
I have to replace the space (which is next to days) with a : and pass the entire value as 1:04:45:47 in a function
How do we replace a space with colon and pass the entire value in the above format ?
Thank you
Bhavana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 05:27 AM
after doing the calculation where do you wish to store it? is it in some duration field or string?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:03 AM
Hi Ankur,
This is how i am doing it. Pls check
pend_dur.replace(' ', ':');
gs.info('pending duration after ' + pend_dur);
//o/p - pending duration after 1 06:45:32
