title: Query hdf5 datetime column
body: <p>I have a <code>hdf5</code> file that contains a table where the column <code>time</code> is in datetime64[ns] format.</p>
  
  <p>I want to get all the rows that are older than <code>thresh</code>. How can I do that? This is what I've tried:</p>
  
  <pre><code>thresh = pd.datetime.strptime('2018-03-08 14:19:41','%Y-%m-%d %H:%M:%S').timestamp()
  hdf = pd.read_hdf(STORE, 'gh1', where = 'time&gt;thresh' )
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-80-fa444735d0a9&gt;", line 1, in &lt;module&gt;
      runfile('/home/joao/github/control_panel/controlpanel/controlpanel/reading_test.py', wdir='/home/joao/github/control_panel/controlpanel/controlpanel')
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
      execfile(filename, namespace)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
      exec(compile(f.read(), filename, 'exec'), namespace)
  
    File "/home/joao/github/control_panel/controlpanel/controlpanel/reading_test.py", line 15, in &lt;module&gt;
      hdf = pd.read_hdf(STORE, 'gh1', where = 'time&gt;thresh' )
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 370, in read_hdf
      return store.select(key, auto_close=auto_close, **kwargs)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 717, in select
      return it.get_result()
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 1457, in get_result
      results = self.func(self.start, self.stop, where)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 710, in func
      columns=columns, **kwargs)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 4141, in read
      if not self.read_axes(where=where, **kwargs):
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 3340, in read_axes
      self.selection = Selection(self, where=where, **kwargs)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/io/pytables.py", line 4706, in __init__
      self.condition, self.filter = self.terms.evaluate()
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 556, in evaluate
      self.condition = self.terms.prune(ConditionBinOp)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 118, in prune
      res = pr(left.value, right.value)
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 113, in pr
      encoding=self.encoding).evaluate()
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 327, in evaluate
      values = [self.convert_value(v) for v in rhs]
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 327, in &lt;listcomp&gt;
      values = [self.convert_value(v) for v in rhs]
  
    File "/home/joao/anaconda3/lib/python3.6/site-packages/pandas/core/computation/pytables.py", line 185, in convert_value
      v = pd.Timestamp(v)
  
    File "pandas/_libs/tslib.pyx", line 390, in pandas._libs.tslib.Timestamp.__new__
  
    File "pandas/_libs/tslib.pyx", line 1549, in pandas._libs.tslib.convert_to_tsobject
  
    File "pandas/_libs/tslib.pyx", line 1735, in pandas._libs.tslib.convert_str_to_tsobject
  
  ValueError: could not convert string to Timestamp
  </code></pre>