<p>Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?</p>

<p>As an example, suppose we have ranges denoted by DateTime variables <code>StartDate1</code> to <code>EndDate1</code> <em>and</em> <code>StartDate2</code> to <code>EndDate2</code>.</p>

I believe that it is sufficient to say that the two ranges overlap if:
```
```
(StartDate1 <= EndDate2) and (StartDate2 <= EndDate1)
```
```