title: How to use pd.IntervalIndex.get_loc() / pd.IntervalIndex.get_indexer() with datetime values?
body: <p>Assuming I have the following DataFrames:</p>
  
  <pre><code>In [86]: d1
  Out[86]:
         Start        End
  0 2018-01-03 2018-11-30
  1 2018-01-06 2018-11-30
  
  In [87]: d2
  Out[87]:
     Document_date
  0     2018-10-02
  1     2018-10-02
  2     2018-06-13
  3     2018-06-13
  4     2018-03-29
  5     2018-04-19
  6     2018-06-13
  7     2018-03-20
  8     2018-06-13
  9     2018-01-25
  10    2018-05-15
  11    2018-04-19
  </code></pre>
  
  <p>I want to create an <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.IntervalIndex.get_loc.html" rel="nofollow noreferrer">IntervalIndex</a> from the first DF:</p>
  
  <pre><code>In [88]: idx = pd.IntervalIndex.from_arrays(d1['Start'], d1['End'], closed='both')
  
  In [89]: idx
  Out[89]:
  IntervalIndex([[2018-01-03, 2018-11-30], [2018-01-06, 2018-11-30]]
                closed='both',
                dtype='interval[datetime64[ns]]')
  </code></pre>
  
  <p>and use <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.IntervalIndex.get_loc.html" rel="nofollow noreferrer"><code>.get_loc()</code> method</a>:</p>
  
  <pre><code>In [92]: idx.get_loc(d2.iat[0,0])
  ...
  skipped
  ...
  KeyError: ('datetime64[ns]', 'both')
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>In [93]: idx.get_loc(pd.to_datetime('2018-10-02'))
  ...
  skipped
  ...
  KeyError: ('datetime64[ns]', 'both')
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>In [94]: idx.get_loc('2018-10-02')
  ...
  skipped
  ...
  KeyError: ('datetime64[ns]', 'both')
  </code></pre>
  
  <p><strong>Question:</strong> what do I do wrong?</p>
  
  <p>Example from the online docs which is using integer intervals is working just fine:</p>
  
  <pre><code>In [97]: i1, i2 = pd.Interval(0, 1), pd.Interval(1, 2)
      ...: index = pd.IntervalIndex([i1, i2])
      ...: index.get_loc(1.5)
      ...:
      ...:
  Out[97]: 1
  </code></pre>
  
  <p>PS I'm using Pandas 0.23.0 (from Anaconda distributive)</p>