title: Bin datetime range using pandas
body: <p>I have a dataframe that consists of a operation id and a datetime stamp for the Start and End of an event.</p>
  
  <pre><code>OperID               Start                 End
     141 2014-03-04 19:28:39 2014-03-04 19:33:38
   10502 2014-03-04 02:26:26 2014-03-08 20:09:21
   10502 2014-03-15 00:03:45 2014-03-15 10:03:44
  </code></pre>
  
  <p>I would like to take this data and be able to easily create bins of various types (month, day, hour) 
  that show how long, within each bin, the operation was in the affected state.  The Start and End dates often span across hour, day, and month boundaries.</p>
  
  <p>My desired output, if I was binning by day, would look like:</p>
  
  <pre><code>OperID  Bin         Seconds
     141  2014-03-04  299
   10502  2014-03-04  77614
   10502  2014-03-05  86400
   10502  2014-03-06  86400
   10502  2014-03-07  86400
   10502  2014-03-08  72561
   10502  2014-03-15  35999
  </code></pre>