How to get day name from glidedate in script-Include? Can anyone help me?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2019 05:25 AM
In a Script Include, I have date(2019-04-12), now how to get day name(Mon-Sun) from that date?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2019 05:30 AM
Hi Mani,
use below code to get the day part
var time = new GlideDateTime(date + ' 12:00:00');
var dayPart = time.getDayOfWeek();
if dayPart is 1 it means Monday; if it is 2 then it is Tuesday so accordingly you can compare
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader