title: TypeError: 'datetime.datetime' object does not support indexing
body: <p>I am having difficulty querying all data from a table during the last 24hrs and it is difficult to say if its a postgres error on my part of python since im a beginner</p>
  
  <p>I see the "publishedAt" field, returns a datetime.datetime value.</p>
  
  <pre><code># print out columns names
  cur.execute(
      """
      SELECT *
      FROM "table"
      LIMIT 1
      """
  )
  
  # print out columns names
  colnames = [desc[0] for desc in cur.description]
  print(colnames)
  
  # print out col values
  rows = cur.fetchall()
  print(rows)
  
  ['id', 'publishedAt', ......]
  [['5a086f56-d080-40c0-b6fc-ee78b08aec3d', datetime.datetime(2018, 11, 11, 
  15, 39, 58, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None)), .....]
  </code></pre>
  
  <p>However,</p>
  
  <pre><code>cur.execute(
      """
      SELECT * 
      FROM "table"
      WHERE publishedAt BETWEEN %s and %s;""", 
      (dt.datetime.now() - dt.timedelta(days=1))
  )    
  </code></pre>
  
  <p>results in: </p>
  
  <pre><code>TypeError: 'datetime.datetime' object does not support indexing
  </code></pre>
  
  <p>is it possible to use datetime library in psycopg2 queries?</p>