Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2019 12:13 AM
How to get only hours on Date/Time field on Script Include?
I'd like to compare current "hours" of Glide time and "hours" of sys_created_on (Date/Time type).
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2019 12:36 AM
Hi,
You can use this logic in your script include
var datetime = new GlideDateTime(record.sys_created_on).toString().split(" "); //Replace record with your glide record
var time = datetime[1].split(":");
var hour = time[1];
gs.info(hour);
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2019 12:36 AM
Hi,
You can use this logic in your script include
var datetime = new GlideDateTime(record.sys_created_on).toString().split(" "); //Replace record with your glide record
var time = datetime[1].split(":");
var hour = time[1];
gs.info(hour);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2019 12:51 AM
Thank you so much for the solution!