- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 11:55 PM - edited 03-04-2024 11:55 PM
Hello!
Irun simple function on background script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 12:02 AM
Hello @Dominik1988
Try like below :
var t = new Date();
gs.print(t.getUTCDay())
Note : Use GlideDateTime API instead Date
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 12:00 AM
Try to use .getDayOfWeekLocalTime();
It must work !
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 12:02 AM
Hi @Dominik1988 ,
Please check your instance time zone and then try script is correct.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 12:02 AM
Hello @Dominik1988
Try like below :
var t = new Date();
gs.print(t.getUTCDay())
Note : Use GlideDateTime API instead Date
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 12:06 AM
Hi you can use below code i try in background script its work