
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 02:18 AM
Hi,
I need to extract the time in below format -
hh:mm:ss:ms
i.e I require milseconds also to be dispalyed along with hours/minutes/seconds.
Please suggest the approach.
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 05:53 AM
Hi,
Can you try below script and check if it gives hh:mm:ss?
var milliseconds = 1536914778000;
var gdt = new GlideDuration(milliseconds);
var value = gdt.getByFormat('HH:mm:ss');
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 11:25 PM
Thanks Ankur.The above code helped in achieving my requirement

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 03:36 AM
kvark I didn't get your point. Please note I am not using service portal here. I am writing this code in UI Action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 03:39 AM
filtering is the same, I use widget to quickly demonstrate that. You need to be more specific if need more detailed help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 05:45 AM
Hi,
So basically you have milliseconds value and want it to be converted to hh:mm:ss:ms ?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2020 07:00 AM
seems she needed sss, not ms, but she hardly can manage to explain...