How to exclude weekend and holidays while calculating duration between two dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 03:39 AM - edited ‎07-26-2023 11:49 PM
Hi folks,
I am having two date time field
Date time field1 : Assess (July 1, 2023 9 am IST)
Date time field2 : Current date time (july 24 , 2023 12 pm IST)
I want to get duration between these two dates and have to save in another field called Work processed time(duration field).
User datediff I am getting duration but this included weekend and US hoildays. How can I achieve excluding weekend and US hoildays.
@Chuck Tomasi
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 03:44 AM
Hello @Fathima6
You can do similar to the below screenshot for excluding weekend in Schdedule Entry :-
For US holidays you can create schedule of holidays and add it in child schedule and select type as include.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2023 10:09 AM
I am sorry, I am not asking how to create schedule entry.
I am asking
I am having two date time field
Date time field1 : Assess (July 1, 2023 9 am IST)
Date time field2 : Current date time (july 24 , 2023 12 pm IST)
I want to get duration between these two dates and have to save in another field called Work processed time(duration field).
User datediff I am getting duration but this included weekend and US hoildays. How can I achieve excluding weekend and US hoildays.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 03:44 AM
Hi,
Have you tried below:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0823046
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0647482
Thanks
Anil Lande