title: sqlite find out the date difference
body: <p>I have table like this:</p>
  
  <pre><code>CREATE TABLE `item_zone` (
      `item`  INTEGER NOT NULL,
      `zone`  INTEGER NOT NULL,
      `action_date`   TEXT NOT NULL,
      `price` INTEGER NOT NULL,
      `days_price_established`    INTEGER
  );
  INSERT INTO `item_zone` VALUES (50374500, 1, 1512248400, 5, 10);
  INSERT INTO `item_zone` VALUES (50374500, 1, 1513112400, 9, 1);
  INSERT INTO `item_zone` VALUES (50374500, 1, 1513198800, 8, null);
  </code></pre>
  
  <p>The table has no some primary key, but i think it's possible to use oid. 
  In action_date it stores UNIX-like data and in days_price_established it stores how much days left from last price changing (action_data(n) - action_data(n-1). I need to show the days_price_estableshed, but i dunno how to property do math with dates. </p>
  
  <p>                 
                   </p>