title: Sqlite3 between hour x and hour y
body: <p>Wanting to build a query that retrieves rows hour by hour, over the last 24 hrs.  My question is more in regards to why one method works and another does not.  I can not find a definitive answer.</p>
  
  <p>Works:</p>
  
  <pre><code>SELECT date, temp 
  FROM dht_temps 
  WHERE zone = 'outside' 
   and temp &lt;&gt; 0 and date BETWEEN "2016-12-19 04:00:00" AND "2016-12-19 08:00:00"
  </code></pre>
  
  <p>Does not work:</p>
  
  <pre><code>SELECT date, temp FROM dht_temps 
  WHERE zone = 'outside' and temp &lt;&gt; 0 
    and date BETWEEN date('now','-2 hours') 
    AND date('now','-1 hours')
  </code></pre>
  
  <p>Seems to me that both should produce the same result but that is why I am a hack.  I would like to understand the why.  Thanks</p>