title: Distributing time in interval buckets
body: <p>I have the following table:</p>
  
  <pre><code>CREATE TABLE f_contact (
      agent character varying,
      datetimeconnect timestamp without time zone,
      datetimedisconnect timestamp without time zone,
      duration integer
  );
  </code></pre>
  
  <p><code>duration</code> is time in seconds between the disconnect time and connect time.<br>
  I might have data like this:</p>
  
  <pre><code>agent   datetimeconnect         datetimedisconnect      duration
  20024   2019-03-18 12:01:00.0   2019-03-18 13:01:30.0   3630
  20011   2019-03-11 08:47:40.0   2019-03-11 09:30:10.0   2550
  </code></pre>
  
  <p>And I want to take that data and distribute the time over 15 minute intervals so I have a result like this:</p>
  
  <pre><code>20024   12:00   840
  20024   12:15   900
  20024   12:30   900
  20024   12:45   900 
  20024   13:00   90
  20011   08:45   740
  20011   09:00   900
  20011   09:15   900
  20011   09:30   10
  </code></pre>
  
  <p>How to achieve this?</p>