79347193

Date: 2025-01-10 22:53:43
Score: 0.5
Natty:
Report link

Use the Subtraction method of the DateTime class for computing the number days for your time interval. Divide the number of days by 7 and multiply the result by 2. That gives you the number of leave days of the full 7-day weeks. Divide number of days modulo 7 ( % 7 instead of / 7). This gives you the remaining days which range from 0 through 6. Count the number of leave days contained in this result which is a number in the range from 0 through 2. Add this number to the number of leave days of the complete weeks and you are done.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Elec1