Get the day of the week
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 09:37 AM
Hi,
Can I get the date of the next Wednesday in a client script ou BR?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 09:41 AM
You can refer to below article to achieve this:
Calculating the day of the week on a glide date (in a client script)
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 09:41 AM
hello ,
Yes you can get it in BR please use below code
var gdt = new GlideDateTime();
var day = gdt.getDayOfWeek();
if(day==3) // 1- monday 2-tuesday 3-wed 4-thursday 5-friday 6-saturday 7-sunday
{
gs.info('its wednesday');
}
please refer to below link for more details
https://developer.servicenow.com/dev.do#!/reference/api/quebec/server_legacy/c_GlideDateTimeAPI#r_GDT-getDayOfWeek?navFilter=week
Please mark this accepted solution if it solved your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 09:43 AM
There is a method available in the GlideDateTime library:
getDayOfWeekLocalTime()
If you want to do this via client script, you can use the native JS 'Date()' functionality