Ashok K

Ashok K

  • NA
  • 96
  • 13k

Date Difference With Weekoff

Aug 30 2018 4:25 AM
For my Asp.net C# website, I want to find the difference between two given dates from user, which should exclude second, fourth Saturday of the month and holidays.
 
I had stored Holiday dates in table.
 
I had used to avoid Sunday by using the following code
if (date.DayOfWeek != DayOfWeek.Sunday).
  
For example:
From Date: 30/08/2018
To Date:    03/09/2018 
I want answer like: Total Days - 3 
 
From Date:  07/09/2018
To Date:       10/09/2018
I want answer like: Total Days - 2 

Answers (1)