title: Round timestamp to nearest day in Python
body: <p>In Python 2.7.2 I am getting the seconds since epoch using:</p>
  
  <p><code>sec_since_epoch = (date_obj - datetime(1970, 1, 1, 0, 0)).total_seconds()</code></p>
  
  <p>Now I want to round these seconds to the nearest day e.g. if:</p>
  
  <p><code>datetime.fromtimestamp(sec_since_epoch)</code></p>
  
  <p>corresponds to <code>datetime(2013, 12, 14, 5, 0, 0)</code></p>
  
  <p>I want the new timestamp to correspond to <code>datetime(2013, 12, 14, 0, 0, 0)</code></p>
  
  <p>I know the ugly way of doing it, but is there an elegant way ?</p>