title: How to check if two datetimes are within a certain range of each other?
body: <p>I have two datetime64 objects, a and b, and I want to determine if they are within a certain range of each other. However, the range is not symmetrical. If a is within -30 and 120 minutes of b (a is between half an hour earlier and two hours later than b), the two are within the desired range. My datetime objects look like %m/%d/%Y %H:%M. I tried saying:</p>
  
  <pre><code>difference = a - b
  if (-30 &lt;= difference &lt;= 120):
      #Do stuff
  </code></pre>
  
  <p>However, this doesn't work because difference is not in minutes. I am not sure how to perform this comparison. I know timedelta can be used for datetime comparisons, but I don't know how to use it with an asymmetric range like this one.</p>
  
  <p>Thanks.</p>