title: Get the first and last times for each day with Python datetime
body: <p>I have a list of timestamps in this format: '2016-08-01 13:02:57' or "%Y-%m-%d-%H-%M-%S-%f"</p>
  
  <p>I would like to get the first and last time for each day. So for if there were two days 8/1 and 7/29 the function would return 4 values. For example:</p>
  
  <pre><code>8/1
  first: '2016-08-01 13:02:57'
  last: '2016-08-01 13:08:44'
  
  7/29
  first: '2016-07-29 14:34:02'
  last: '2016-07-29 14:37:35'
  </code></pre>
  
  <p>The first time is the one that occurs first in that day, the last time is the one that occurs last in that day.</p>