- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 12:04 AM
Hi All,
I am getting the date and time value from the script var ab= 2024-12-24 05:48:45; but in the i want only the 05:48 time only and stored in the one of the variable , Can anyone suggest how to get it .
Thanks ,
Chandan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 12:30 AM
Hi @chandanpatra i check in background script my code is working fine use below script and do modification as per you need
If my answer helps you mark helpful and accept solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 12:30 AM
Hi @chandanpatra i check in background script my code is working fine use below script and do modification as per you need
If my answer helps you mark helpful and accept solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 12:45 AM
you are doing this in server side or client side?
you will have to use string manipulation and get only the hours and minutes
var ab= 2024-12-24 05:48:45;
var time = ab.split(' ')[1];
var hourMin = time.split(':')[0] + ':' + time.split(':')[1];
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-24-2024 12:57 AM
as per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader