Hello all,
I was wondering if there exists a neat effective way of calculating the number of days two date intervals overlaps?
Example:
Interval 1: 5. jun 2011 - 21. jun 2011
Interval 2: 10. jun 2011 - 15. jun 2011
Interval 3: 1. jan 2011 - 30. sep 2011
Intersection( interval 1, interval 2 ) = 6 days
Intersection( interval 1, interval 3 ) = 17 days
Many thanks!
I was wondering if there exists a neat effective way of calculating the number of days two date intervals overlaps?
Example:
Interval 1: 5. jun 2011 - 21. jun 2011
Interval 2: 10. jun 2011 - 15. jun 2011
Interval 3: 1. jan 2011 - 30. sep 2011
Intersection( interval 1, interval 2 ) = 6 days
Intersection( interval 1, interval 3 ) = 17 days
Many thanks!