I have two sets of dates (4 dates total), let's call them sets A and B. I need to see if set B date range is found in any order in set A. Below is an example of how the dates would be found:
Set A:
Start Stop
11/9/2017 11/10/2017
11/16/2017 11/18/2017
Set B
Start Stop
11/7/2017 11/11/2017 # should match the first one in set A
11/15/2017 11/16/2017 # Should match the second one in set A
I figured a set of <
>
's would work, but I can't seem to get it to match what I am looking for.
I have tried the following:
start1 = datetime(2017,11,9)
stop2 = datetime(2017,11,10)
start2 = datetime(2017,11,7)
stop2 = datetime(2017,11,11)
start1 >= start2 or stop1 <= stop2
this yields true. But i feel that i may be missing some by having the or
, in there.